Git Product home page Git Product logo

Comments (8)

reubene avatar reubene commented on August 30, 2024 1

This would allow people to add more wonders too if they wanted to

from civ2-clone.

axx0 avatar axx0 commented on August 30, 2024

I'll take a look at it.

from civ2-clone.

axx0 avatar axx0 commented on August 30, 2024

Ok so it's the transporter thingie.
No of units, terrains, leaders, etc. however is the same in TOT/MGE (well there are more units in TOT but they appear at the end of the list so it's not really an issue).

Sadly, I've found a scenario where Capitalization is not in brackets so that option's off. Also the name Capitalization can be anything in scenarios, like Wealth, Harry Potter House, etc.

My suggestion is not to mess with interfaces too much and do this:

  1. Add transporter to ImprovementType.cs at position 35 so we have a universal enum for both interfaces
  2. At ProcessImprovements in RulesParser.cs count the number of values at the end of method.
  3. If the number of values = 68 it's TOT and you don't have to do anything.
    However if the number of values = 67 it's MGE and in that case you just have to increase Type of all improvements after port facility by one:
            if (values.Length == 68)
            {
                Rules.Improvements.Where(i => (int)i.Type > 35).Select(i => i.Type += 1);
            }

That way the Transporter enum for MGE will be skipped. And you won't have to change ProcessEndWonders.
That's my suggestion but I haven't tested this.
Also this is ok if the no of improvements in all TOT scenarios =68, which should be the case but I'm not 100%.

from civ2-clone.

reubene avatar reubene commented on August 30, 2024

Thanks for looking into it I think it might be useful to leave if flexible as I'd like our engine to be more mod-able than the original not less. I think the ImprovementTypes enum should probably be removed as it limits mod-ability of city improvements.

It has occurred to me that every wonder needs an entry in the ENDWONDER section. Perhaps the best way to work out where the first wonder is is to work the other way. If there are N entries in the ENDWONDER values array we apply those to the last N improvements. That way it won't matter how many improvements there actually are and modders will be free to add more if they need.

from civ2-clone.

axx0 avatar axx0 commented on August 30, 2024

It has occurred to me that every wonder needs an entry in the ENDWONDER section. Perhaps the best way to work out where the first wonder is is to work the other way. If there are N entries in the ENDWONDER values array we apply those to the last N improvements. That way it won't matter how many improvements there actually are and modders will be free to add more if they need.

Good that you've noticed that! I think it's a good approach.
Also if we remove improvementtype enum we'll probably have to remove other similar enums as well.

from civ2-clone.

axx0 avatar axx0 commented on August 30, 2024

But if the enums are removed how will you know which logic to hook up individual wonders and improvements to?

from civ2-clone.

reubene avatar reubene commented on August 30, 2024

Have a look at improvements.lua that's a ones I've already implemented no enum required, and it's lua so very easy for people to modify

from civ2-clone.

axx0 avatar axx0 commented on August 30, 2024

ok yeah, you basically just need an index of an improvement

from civ2-clone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.