Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Developer thread

Now that there is more than 1 developer working on this, I figure its easier to talk in a thread tahn in PMs.
Reply

OK so about the project:

There are multiple parts,

Gamestate: these classes define the elements that make up a game in any point of time. Basically this is the data layer (or model). These are self-contained, (only gamestate objects are used by gamestate objects)

These are moslty static, very few calculations (like, calculating workers from farmers and rebels, so that there is no discrepancy with total population)
Most things are stored in properties. I lie, ALL things are stored in properties.

The event system: whenever a property is read, an event is fired. Things can subscribe to events and add modifications to the value. This is how bonuses work (enchantments, special abilities, etc)

There is no predetermied way on how this has to work. But:
most integer type properties work very much alike. First additions, then multiplications, thats why I have an IntArgsBase class, that defines these.

GameLogic:
The gamelogic contains all classes needed to do modifications to the gamestate. The gameLogic is kept separate from the gamestate (meaning GameState has no access to Gamelogic objects), but has access to all gamestate objects.

The basic modus operandi is that NetworkEvents occur, which then cause the gamestate to change. The only class allowed to actually change the state is ObjectManager, each networkEvent must use it to do its effect. I think all networkevents are covered already, but their process() is beeing done one by one as I come to it.

NetworkEvents offer a number of access points (via .NET events, and ManualResetEvents) for the UI to reflect upon changes in the gamestate.

The gamelogic also contains rules about world creation, and config files (that contain everything changeable, including unit stats, races and so on) (this is under construction)

The network layer is also here. (not implememnted yet)

The UI: the UI is kept separate from the above two (nor gamestate nor gamelogic has access to UI objects) , but can use any of them objects.
(The main purpose of this beeing, that people may write their own UI (or config) but still play the same game as someone with a different UI.)

The UI has two tasks: presenting the gamestate to users, and to read input from users. User input will be then transformed into Network Events, that are sent to the network(currently it pushes them directly into the gamelogic, but that should change later when the actual network layer is done)

The current Ui uses OpenTK. The main object is called UILogic, this is the one that draws the screen, and procides some services.
The different screens are implemented via a class derived from the Screen class.
Screens can draw and handle buttons, which are basically a simple rectangle where muse clicks are registered. If you want a new button, you have to define it, and add to the Buttons property of the base screen class. Drawing buttons is done separately. Button handlers are implemented separately as well.

The UILogic holds a reference to the current screen, and a reference to the current UIAction.
The UIAction is the part where ui effects are drawn. For example there is a MoveUnitUiAstion that moves a unit from one MapTile to the next pixel-by-pixel, but all animations should be done trough this. Note: this might proove to be not enough (wehnever we want multiple UI actions), so a redesign is possible.

This is how it stands on my comp. Im planning an update of the source this week, Ill include text display and some changes, so it might not exactly be what you see from sfnet.

Im sure I left a lot out, so feel free to ask here.
Reply

Oh yea, few more things.

I use ninject as IOC. If you have any questions about this, ask, but it is pretty straightforward, as I use very few of its capabilities so far (teh most basic ones, really).
I plan to use an agile approach.
Id be interested in your opinions on unittests. I did plan to have them, I just never seem to come around actually making them.
Im also curious on your stance of reusing GPL-ed mom remake attempts.
Reply

Looks good, I like the way you've setup the projecct so far. I agree that keeping the game logic and state seperate for the UI is a good idea that allows us a lot of freedom in the future for different UIs (HTML5 anyone smile).

I also like the event system setup.

I'm most comfortable writing processing systems so I'll probably be most useful in the game logic and network level.

Unittests are useful, I've never really worked on a project that had more than a handful for core components though.

I'm all for agile programming, I find it's much easier than other approaches to actually get something done.

As for reusing other GPL-ed remakes I've not looked at them to know. Though they may have already solved some problems we are going to run into and may benefit us to at least look at them from a here's how someone else did it stand point. I'll make a point to look at them this week.

I'm sure I'll have more questions once I get to go through the code more thouroughly.

Files I'm missing from svn:
GameLogic\ConfigItemSubscriber.cs
GameLogic\RuleSetAccessor.cs
GameLogic\EventArgs\ConfigItemSubscriber.cs
GameLogic\EventArgs\RuleSetAccessor.cs
GameLogic\EventArgs\City\GetCityScoutingRangeArgs.cs
GameLogic\EventArgs\City\GetMaxPopulationArgs.cs
GameLogic\EventArgs\City\SpawnUnitArgs.cs
GameLogic\GameState\ISubscriber.cs
UI\Screens\ChangeProductionScreen.cs
UI\Screens\IDialog.cs
UI\TextDisplay\Text.cs

I think that's all of them.
Reply

I added the files.
Reply

Thanks. I've looked over most everything except the ui portion. I'll probably get to that tomorrow.

I think I'm following how you have things laid out. The easiest way to get me up to speed would probably be a skype session where I can look at the code and ask questions and you can tell me what you want me to begin creating.
Reply

Actually I only have google talk, so maybe that one?

Also, Im GMT+1, and im usually only at my comp after the kids went to sleep (21:00+), and only on some days (mondays, wednesdays and fridays).

I have updated the sources.
Reply

Ok, google chat is fine. I'll get the updates to the code. This weekend I'll have a lot of free time so I would like to work on something. If I don't hear from you I'll try and pick something that hasn't be implemented yet and run with it. Hopefully we won't duplicate efforts. I'll post here before I start working.
Reply

I have uploaded the text writer part. Now it should be easy to write text, check cityscreen for an example.
I also figured out a way to do the recoloring.

How are you progressing?
Reply

I ported the map generation code out of MoM-Shell to get a better idea of an implementation for the map generation. So far I created a quick test program. It's functional and I'll add more configuration points before I put it in the project. The different colors correspond to different terrain types.
[Image: TestMap.jpg]
I do not think it is an ideal solution, and the algorithm definitely needs some changes.

What are your thoughts?
Reply



Forum Jump: