Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » New Waypoint System
New Waypoint System Sun, 29 April 2012 18:29 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
Yet another semi-big system change, so a new thread for reference.

Waypoints are now grouped into:

Common/Waypoints
Contains the classic Waypoint definition with a few modifications, and the new IWaypointTask interface and it's implementations. These implementations (ColoniseTask, LoadTask, etc) are plain data containing objects used by the client to set waypoint orders (Task name, amounts, time, etc). Still lacks in depth implementations as they are a bare port of the old waypoint Enum.

Server/Waypoints
Contains the WaypointExtension class, which adds a server specific operation for the Waypoint class to load a proper IWaypointTaskWorker implementation (all located here) to actually carry out the tasks. These worker classes are an extended port of the previous WaypointTasks class, and now contain validation and full execution, including Star ownership exchange and fleet cleanup when appropiate, in favour of grouping such things logically instead of the server handling them all "blind" (like fleet cleanup).

So, to create a new waypioint task:

1. Create a NamehereTask that implements IWaypointTask in Common/Waypoints with order/client data.
2. Add it to the SetTask() method in Common/Waypoints/Waypoint.cs
3. Create a NamehereTaskWorker that implements IWaypoinTaskWorker in Server/Waypoints to carry out the procedure.
4. Add it to the LoadWorker() method in Server/Waypoints/Waypoint.cs

That's it, it should be auto loaded and executed when appropiate.

Report message to a moderator

Re: New Waypoint System Sun, 29 April 2012 23:14 Go to previous messageGo to next message
Daniel is currently offline Daniel

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

Messages: 179
Registered: April 2006
Location: Nowra, Australia
Nice work, can't wait to try it out this weekend


Have fun.

Report message to a moderator

Re: New Waypoint System Thu, 03 May 2012 22:03 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
The design, while a step to a more flexible system, has some flaws.

I'm trying to refine it a bit and think it through a little more.

Report message to a moderator

Re: New Waypoint System Fri, 04 May 2012 18:36 Go to previous messageGo to next message
Daniel is currently offline Daniel

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

Messages: 179
Registered: April 2006
Location: Nowra, Australia
I see that cargo transfers are not working yet. I hope to have a bit more of a look at it this weekend.


Have fun.

Report message to a moderator

Re: New Waypoint System Fri, 04 May 2012 23:34 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 have them partially working on my local copy... but i'm not entierely happy with the cleanliness of the system.

The thing is this:

Most Tasks need access to ServerData because they modify several things from several collections, and cosider data from several empires (Like invasions for example; need both Races). Hence the TaskWorkers which can't exist on Nova/Common because it can't reference Nova/Server where ServerData exists.

Now, in the case of manual cargo via xfer dialog, the waypoint is properly created, but we are working with Tasks, not TaskWorkers so there is no "clean" way of applying the task to the client state to immediatly display the results of the manual cargo modification. I had to drop in a piece of code that is pretty out of place to do so and defeats the purpose of havint that code contained in the TaskWorkers.

What i'm thinking is merging the TaskWorkers from Nova/Server into the Tasks in Nova/Common, and change the interface to use two EmpireDatas instead of a ServerData. That way they can work in both Client & Server without resorting to the tricks I placed there.

Unless some task needs to take into account more than 2 empires, which I can't think of any at the moment (Since there is always one instigator and one target).

EDIT:

Yes, that approach was much more cleaner and better, and I'm pretty happy with it. I plan to make some refactorings and comments here and there, but I've commited it in the meanwhile if you want to play with it. Cargo Transfer dialog is working now too.

Things that need improvement:
* Cargo transfer dialog creates waypoint commands that appear on the waypoint list. Have to somehow omit them from there (or perhaps not?)
* Waypoint 1 and 0 load cargo controls need to be done.
* Test some more Razz


[Updated on: Sat, 05 May 2012 00:45]

Report message to a moderator

Re: New Waypoint System Sat, 05 May 2012 05:17 Go to previous messageGo to next message
Daniel is currently offline Daniel

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

Messages: 179
Registered: April 2006
Location: Nowra, Australia
Where are the task workers?

-- edit

Never mind, I found them.


[Updated on: Sat, 05 May 2012 05:20]




Have fun.

Report message to a moderator

Re: New Waypoint System Sat, 05 May 2012 05:24 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
Task workers are no longer used, just use the Tasks in Nova/Common.

EDIT:

I found out why you had that repeated production bug. Apparently Commands are not being cleared upon completition so they repeat each turn. This makes colonization broken as colonists are loaded as soon as the planet is colonized, lol.

I'll look into it tomorrow, as I need to get some sleep.


[Updated on: Sat, 05 May 2012 05:40]

Report message to a moderator

Re: New Waypoint System Tue, 08 May 2012 00:21 Go to previous message
Aeglos is currently offline Aeglos

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

Messages: 142
Registered: May 2011
Location: Chile
Alright, Split/Merge fleets is done via Manual dialogs. Waypoint UI is pending for it, but the commands are done and work.

Some bugs that need fixing: When splitting and giving waypoints to the newly split fleets, they won't go through as the fleet does not yet exist when the commands are parsed.

Waypoint list is still getting full of repeated "temporary" waypoints. Need to devise a way to fix that. (Probably allowing for more than one task per waypoint).

I think only manual cargo transfer remains. Since the CargoTask is done it shouldn't pose much trouble to implement, I'll prolly get to it this weekend, as I'll be away till Friday.

Cheers!

EDIT: Another bug I just recalled, when merging fleets the fuel/cargo distribution is funky.


[Updated on: Tue, 08 May 2012 00:33]

Report message to a moderator

Previous Topic: Some important-ish changes.
Next Topic: Orders
Goto Forum:
  


Current Time: Thu Apr 18 00:57:05 EDT 2024