Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » I've branched the Codebase [Merged back into trunk]
I've branched the Codebase [Merged back into trunk] Fri, 24 June 2011 06:48 Go to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
I just implemented the StarIntel for use on the client; it will replace AllStars, PlayerStars and StarReports all in one. When i plug it in, I will then do the same with Fleets.

I realized that the changes are extensive and potentially disruptive so I've branched out as to not mess you guys up. I'll merge back when I reach a meaningful bug-free milestone in the refactoring... which will probably be when i'm done with it Laughing

Since I branched, I'm considering starting on the server turn step generalization. I have to change the turn generation anyway for the new datastructures, and changing the server now AND then later again would be most redundant. I'll try to keep focused on the datastructures only though, as changing the turn generation is an even bigger task than changing the ClientState.


[Updated on: Tue, 28 June 2011 01:08]

Report message to a moderator

icon7.gif  Re: I've branched the Codebase Fri, 24 June 2011 11:26 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
Woot! good luck Cool

Report message to a moderator

Re: I've branched the Codebase Fri, 24 June 2011 12:47 Go to previous messageGo to next message
evild00d is currently offline evild00d

 
Crewman 2nd Class
Stars! Nova developer
Stars! Nova developer

Messages: 14
Registered: July 2009
Location: Norway
Just a heads-up that merging in Subversion can be quite painful. I should really revisit the git conversion...

Report message to a moderator

Re: I've branched the Codebase Fri, 24 June 2011 16:03 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
Branching in SVN can be crap.

Git? As long as there's a visual studio plugin for it... never used it so I'm cautious but I know a lot of people do use it.

Report message to a moderator

Re: I've branched the Codebase Fri, 24 June 2011 16:15 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
I'm a little fonder of Mercurial personally. Too bad SF doesn't offer it.

Report message to a moderator

Re: I've branched the Codebase Sat, 25 June 2011 04:16 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Well, all unit tests seem to have broken in the branch. They fail with errors such as "Cannot load assembly Nova.Common.Fleet[]" or "TestFixtureSetUp failed" and the most colorful: "System.MissingMethodException : Method not found: 'System.Threading.Monitor.Enter'." I have no idea what's going on.

EDIT: Also, should the branch be merged regularly back to the trunk? For example, it's now in a pretty stable state and synched with the trunk, with only very minor quirks that will probably need to wait till the server is redone to be fixed anyways.

And I also got rid of the repeated component loading dialogs with a simple check, so I can tease you about not having to suffer that loading bar a million times too Cool


[Updated on: Sat, 25 June 2011 04:30]

Report message to a moderator

Re: I've branched the Codebase Sat, 25 June 2011 06:27 Go to previous messageGo to next message
FurFuznel is currently offline FurFuznel

 
Lt. Junior Grade
Stars! Nova developer
Stars! Nova developer

Messages: 437
Registered: November 2002
Location: New Brunswick, Canada
Aeglos wrote on Sat, 25 June 2011 05:16


And I also got rid of the repeated component loading dialogs with a simple check, so I can tease you about not having to suffer that loading bar a million times too Cool


Sounds good. As long as you are not getting rid of the loading bars altogether. For some reason when running the game on the Mac the progress bars (and therefore progress) grind to a halt, unless I am moving my mouse around the screen. Therefore, it is important to still have the visual cues that something is happening so I can remember to speed it up by moving the mouse. Rolling Eyes

With regards to merging back into the trunk frequently, if you are able to make small incremental merges back into the trunk, then you may not have needed to branch. As long as your merging back into the trunk does not cause any significant breaks in the program it would likely make your life easier to keep the trunk and branch similar... if your changes are going to make significant breaks it may make more sense to merge trunk into your branch periodically so that there are fewer differences when you are ready to bring the branch back into the trunk.

Shadallark



Shadallark <==> FurFuznel
Mental anguish is for those who choose to think - FurFuznel
running Mac OS X 10.6.7

Report message to a moderator

Re: I've branched the Codebase Sun, 26 June 2011 15:41 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
Thinking more on this - if you want to work on trunk that's fine with me. I'd rather take the hit of finding issues for the sake that we'll find them faster

Report message to a moderator

Re: I've branched the Codebase Sun, 26 June 2011 19:16 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
To be honest I was thinking of merging back soon. The big bug hunt of the initial StarIntel is already done so I know what to look for when the FleetIntel gets plugged. I'll probably merge back later today and end the branch. This way more important changes like IDs can get done now rather than later.

I wanted to get some input on data design though. Currently the StarIntel object holds Age, IntelLevel (determined by the server, and mandates how much info you get) and a Star object. The server populates the Star object form a full game star and the IntelLevel and you can access it on the GUI with StarIntel.Star. It will only have information that the server sent you, so for example colonists will be 0 for all stars you don't own.

While this works, I find it... flaky. Having a Star inside a StarIntel just feels weird. It would probably feel more robust if StarIntel extended Star and just added Age, IntelLevel and the Update method to set data according to IntelLevel.

Passing only data is not an option since a Star has a number of Properties and methods that are useful on the GUI, like GetResourceRate() and the ProductionQueue, same as Fleet like Mass mass and FreeWarpSpeed. Coding those again is redundant.

For fleets I'm contemplating a similar issue. Fleet has much less variables to set, but the property of FleetComposition which gets the Design Names and Qty, which is extremely convenient for the GUI, depends on the Fleet having proper Ships, which if passed fully to the GUI would defeat the purpose of the FleetIntel in the first place.

I also thought of adding IStar and IFleet interfaces and making Star, Fleet, StarIntel and FleetIntel all from those, sort of use the composite pattern but decided against it since it would be over complicating things.

I will go for StarIntel and FleetIntel extending Star and Fleet. It simpler for the GUI to manipulate them that way, and the data setting logic would be almost as containing them as objects.

I'm doing this on the premise that there should be just one collection for fleets and one for stars, both owned and enemies, and that only data amounts differ.

Report message to a moderator

Re: I've branched the Codebase Mon, 27 June 2011 03:22 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
The way I saw this working is that the client intially gets the list of star names and positions and nothing else. It can then make Star or StarReport objects from these. Each turn it may get new StarReports which it then uses to update its objects - so the client persists its Stars, then on a turn reloads them and copies any Intel over the top (i.e. Intel would neither contain nor extend a star)

Aeglos wrote on Sun, 26 June 2011 19:16


I wanted to get some input on data design though. Currently the StarIntel object holds Age, IntelLevel (determined by the server, and mandates how much info you get)


Rather than an Age field can I suggest a Year field as that then won't ever need to change each turn and the age can be worked out as needed by the client

Aeglos wrote on Sun, 26 June 2011 19:16


I also thought of adding IStar and IFleet interfaces and making Star, Fleet, StarIntel and FleetIntel all from those, sort of use the composite pattern but decided against it since it would be over complicating things.



Agree - Keep it simple for sure Smile

Report message to a moderator

Re: I've branched the Codebase Mon, 27 June 2011 04:07 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Good idea on the Age/Year thing. I'll go with year.

Musmuris wrote on Mon, 27 June 2011 03:22

(i.e. Intel would neither contain nor extend a star))


I've gone with extending it, otherwise it makes no sense code-wise. An Intel report would have the exact same variables plus Year/IntelLevel and be a different unrelated object altogheter. It would double maintainability and be much more error prone; any changes we introduce to a star are now auto done on an StarIntel object, same as in fleet. They also use the same serialization and since an Intel object is of base type Fleet/Star, plugging them into the code already there in the GUI was trivial.

The thing is that both enemy and own info are sent through intel reports; it's just the amount of key info you get that changes. The difficulty arises when selecting what to send... for enemy fleets I need to send the Fleet's FleetShip<Ship> collection so that the FleetComposition property works, but doing so reveals their designs. I'll probably just loop over the sever's Fleet.FleetShips collection copying the names to the intel's FleetIntel.FleetShips when constructing a FleetReport for enemy ships.

I think there might be some miscomunication about how I intended this intel objects work. Laughing

Report message to a moderator

Re: I've branched the Codebase Mon, 27 June 2011 19:12 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
I think I'm ready to merge the branch back. FleetIntel and StarIntel objects are now used everywhere.

The only noticiable bug is that the StarMap no longer draws orbiting fleets, since Star.OrbitingFleets was previously set on the client and not on the server, so it's always null now. I'll sort it out once the server restructure is underway.

There might be some bugs I haven't caught, but I think it's better if you guys help track those down and you can move to a leaner ClientState.

So, does anyone have any big pending commits so I can merge it to the branch before closing it?

Report message to a moderator

Re: I've branched the Codebase [Merged back into trunk] Tue, 28 June 2011 01:26 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Ok guys i've merged the branch back into the trunk. I haven't deleted yet it in case something went wrong.

I got several tree conflicts which I tried to manually fix and the merge seems to be working here (my Windows machine), if you are on Mono and it breaks, please let me know so I can see where messed up. (I'm weary cause I had some tree conflicts with some .resx files and .designer files for the cargo dialogs).

The ClientState and GUI now uses StarIntel and FleetIntel objects for it's data. There are some bugs that I know of and will fix shortly:

1. Homeworlds loose track of their starbase after the first turn. This is an issue that needs to be adressed after implementing the new consistent Ids as collections are being sorted and serialized in different ways sometimes.

2. The Server/TurnSteps/ScanStep.cs file which contains the server's Scanning turn step (new turn tentative structure) has a logic bug. It modifies some collections during a foreach and invalidates it's own iterators. The game works until you actually scan an enemy fleet with your own fleets. This TurnStep has a plethora of loops to handle scanning and can surely be refactored so that it's cleaner and more efficient, as I coded it rather hastly.

3. Orbiting fleets are not drawn (ellipses around a star) as they were previously determined client-side and that functionality is gone. The Star variable OrbitingFleets is not even serialized, so this needs some work and to be done server-side now.

4. Fleets expose too much information when scanned, this has to be revised. It's simple though, just move variables on the FleetIntel class Update() method up a higher level of intel amount... I didn't yet because some fleet unset variables cause a bunch of null reference crashes (like ship components).

Again, if something broke badly in the build i'm really sorry. You guys were right... SVN merging is a chore. Evil or Very Mad
I filed bugs for #1 and #3 to the tracker. #2 I intend to revisit soon and those algorithms are temporary anyways, as is #4 which is a WIP.


[Updated on: Tue, 28 June 2011 01:32]

Report message to a moderator

Re: I've branched the Codebase [Merged back into trunk] Tue, 28 June 2011 04:42 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
wOOt 2

Nice one. Hopefully will get some time to look tonight Smile

Report message to a moderator

Re: I've branched the Codebase [Merged back into trunk] Tue, 28 June 2011 05:07 Go to previous message
Daniel is currently offline Daniel

 
Chief Warrant Officer 3
Stars! Nova developer
Stars! Nova developer

Messages: 179
Registered: April 2006
Location: Nowra, Australia
Sounds like a big step in the right direction. I should get some time this weekend to do some testing and get familiar with the changes.


Have fun.

Report message to a moderator

Previous Topic: Where y'all from
Next Topic: "Intel" class becoming obsolete.
Goto Forum:
  


Current Time: Thu Mar 28 12:06:46 EDT 2024