I think Ive figured out how to implement a randomized stargate network with the current codebase. It requires an all out mod rather than just an extension, but thats unavoidable anyway- we cant (as far as I can tell) alter the starsystem topology in an extension yet.
I cant figure out any way to add new stargates to systems haphazardly, because they dont get the system topology. I had a look at what options were in the system topology code, and unless there was something I am missing, the options there arent good for much beyond what they are used for in the regular game- you can swap in an alternative chunk, but it pretty much requires a bottleneck before and after.
However, based on some experimentation, it seems easy to *remove* unwanted stargates- just objGateTo them into some unused system where they will never be seen again. And this can be done in OnCreate scripts, where we have access to whatever random numbers and data structures we want to set up.
Therefore, we should be able to do the following:
Set up a system topology with every possible linkage linked in.
Set up the star systems to have all the required stargates for the links.
For generic systems, set the systems up such that all systems have the maximum number of gates (the maximum number you need anywhere). For the systems where you dont want that many gates, we will just remove the surplus later.*
In Eridari's OnCreate, generate a table of which links we actually want in the game.
In each systems OnCreate events therafter, remove the unwanted gates. The generic systems should be able to be handled by using the system's name as a lookup into the table. (this will require some duplication in the table where the starsystem topology assigns variable names)
Ill try to organise a proof of concept- probably set up a network between Eridari & StK's- but is there either:
a) something I've missed that means this wont work?
or
b) something I've missed that would make a much simpler approach work?
---
* This means you dont need a bunch of generic-system-with-3-gates, generic-system-with-4-gates etc etc etc (which starts to add up once you figure in that theres 6 different types of generic system that would need different numbers of gates). Since they are going to be removed, it doesnt matter if they dont go anywhere useful (the game needs to understand it, but the player will never see those gates).
On stargate networks
I have a working prototype now, but my internet is down at home, so it'll be a while before I can put it anywhere 8-(
At the moment, I have the following (this diagram may not be very useful, since Im typing through a ssh terminal...)
ES, CP, BA, SK are eridari, charon, battle arena, StKs
g# is a generic system of that level
The horizontal links are fixed, the vertical links have 50% probability (one of the middle ones is tweaked if it detects no other links)
Yeah, its pretty simple for now, but I wanted to make sure it *works*. And it does. Even if at the moment it involves a truly hideous switch/case statement on every system name...
At the moment, I have the following (this diagram may not be very useful, since Im typing through a ssh terminal...)
Code: Select all
ES - g1 - g2 - g2 - g3 - CP
| | | |
BA - g2 - g2 - g3 - g3 - SK - ...
g# is a generic system of that level
The horizontal links are fixed, the vertical links have 50% probability (one of the middle ones is tweaked if it detects no other links)
Yeah, its pretty simple for now, but I wanted to make sure it *works*. And it does. Even if at the moment it involves a truly hideous switch/case statement on every system name...
-
- Militia Lieutenant
- Posts: 193
- Joined: Sun Oct 08, 2006 6:01 pm
Sounds like a good proof of concept model to me.