Logo Platform
logo amplifiers simplified

Galaxy Generator explained

Reply
Copied to clipboard!
12 years ago
Aug 12, 2012, 10:06:50 AM
Dagobert wrote:
this is exactly the bug i sayd.

Just remove the Destructor of the class Galaxy.

And it will work when you make multiple Galaxys in short time.




Yes, I noticed that bug and when I removed the desctructor I could indeed generate multiple galaxies in a row.

But this error is different. I am not generating multiple galaxies. I'm not even running any of my custom code, because I commented that all out. Even when I compile a freshly downloaded Galaxy Generator (from the OP) it still gives me this error. So I think that they may have renamed some classes in the last patch(es). Or otherwise changed the generator code.
0Send private message
12 years ago
Aug 13, 2012, 6:43:36 PM
Any news on this? I can't move forward not knowing what is wrong and what will take to fix it.
0Send private message
12 years ago
Aug 12, 2012, 8:27:08 PM
Ravine wrote:
I'll definitely look into it at work; that's why i was wondering if any "ready to test package" was available.


I am not sure you have fully read the thread; we claim the *original sources* in post #1 no longer work with 1.0.14. So, the "ready to test package" is your own package.
0Send private message
12 years ago
Aug 12, 2012, 7:23:58 PM
Ravine wrote:
I'll definitely look into it at work; that's why i was wondering if any "ready to test package" was available.




I could upload a dll if you want (or you can grab the source from github if you want). But first try and get it working with the provided files in this thread, because even that is not working...

Thanks for the dev attention by the way.



Edit: I've attached a compiled .dll of the provided sources that are attached to this topics' OP. But even then I would suggest you get the sources from this topic, because maybe I/we did something wrong.
Amplitude.GalaxyGenerator.zip
0Send private message
12 years ago
Aug 12, 2012, 6:54:28 PM
I'll definitely look into it at work; that's why i was wondering if any "ready to test package" was available.
0Send private message
12 years ago
Aug 12, 2012, 4:48:57 PM
@ ravine, that is great. Can you confirm that the distributed source code in the OP of this thread, works for you with 1.0.14? The claim is that it does not. In this case, it "should be easy" for you to verify internally whether the file format has changed, and then update the OP with the working source code.
0Send private message
12 years ago
Aug 12, 2012, 4:30:03 PM
Is there any package that i can retrieve to test this out ? A whole pack, dll, xmls and stuff ? (hi, by the way, i'm the new guy). And i think i remember that Calavoow you're the one with the source on github right ? I'm going to ask if it's possible to put an "official" package (or at least an "original" one) so one can fork it easily and we can track changes and get pull requests and stuff like that.
0Send private message
12 years ago
Aug 12, 2012, 3:31:28 PM
i have testet it and the same method is still there.

And with the same parameters.



So you can call it but it will fail for some reason.



Source Code is not important for me. just the interface but if it doesnt work.
0Send private message
12 years ago
Aug 12, 2012, 3:18:37 PM
It sounds like there is a fatal flaw in the distribution system. If the dev team updated the galaxy generator source code and interface in 1.0.14, but did not update the published source code, we are dead in the water.
0Send private message
12 years ago
Aug 12, 2012, 10:50:38 AM
now i see my second change i made.

Also in Galaxy

public static void Release()

{

if (Instance != null)

{

Instance.Configuration.ResetNames();

Instance.Planets.Clear();

}

Instance = null;

}

so that you always have enough names. But it will not help with this problem.





Just downloaded the files and you are right.

A short look in the dll reveals there is Triangulation.



But the question is. What did they change that it will not work.

Since the Generator don´t even gets startet

it´s probably only the name of the method/class.
0Send private message
12 years ago
Aug 14, 2012, 6:04:05 AM
Sorry, i thought i had post, and apparently not.



There has been an update of the dll, so yes, basically, yours wont pass. We'll put the new source as soon as possible.



In the meantime, i've talked about that issue, and suggested to put our code on a public repository under some open source licence. We still have to choose that license, and the code repository. So you can fork, modify, release, and stay up to date if there are any further changes.



(Update : this will happen after the Gamescom though, so dont expect it before next week)
0Send private message
12 years ago
Aug 12, 2012, 9:35:30 AM
this is exactly the bug i sayd.

Just remove the Destructor of the class Galaxy.

And it will work when you make multiple Galaxys in short time.
0Send private message
12 years ago
Aug 11, 2012, 7:38:30 PM
It is possible that the dev team has completely changed the source code from one release to another. Is there a process to make sure the distributed source code stays up to date? That is where I would look first. If they have changed the source code, you will have to "unix patch" your changes into their updated files or nothing will work.
0Send private message
12 years ago
Aug 11, 2012, 4:15:59 PM
I'm having trouble getting my GalaxyGenerator working with Endless Space now. My tester which runs the generator with the data xmls provided works perfectly but when I try to integrate it back into the game I encounter an error. I have made working costum generators in the past so I don't know what is different now, maybe an update? Error log:

[code]

NullReferenceException: Object reference not set to an instance of an object

at Game.Dispose (Boolean disposing) [0x00000] in :0



at Game.Dispose () [0x00000] in :0



at GameManager.ReleaseGame (.GameSaveDescriptor gameSaveDescriptor) [0x00000] in :0



at ApplicationState_CreateGame.Run () [0x00000] in :0



at FiniteStateMachine.Update () [0x00000] in :0



at Application.Update () [0x00000] in :0



(Filename: Line: -1)[/code]



This happens when I create my own mod according to the tutorial, but also when I replace the .dll in the SteamApps folder. Everything works fine when I revert to the normal .dll though.

For further debugging I even unhooked any custom code (by commenting) from the generation process. But to no avail smiley: frown



I noticed that the .dll name is different from the one generated by the project, Amplitude.GalaxyGenerator.dll instead of GalaxyGeneratorPlugin.dll. I can't remember if this was also the case when my custom generators did work though.
0Send private message
12 years ago
Aug 5, 2012, 9:59:06 PM
I found a BUG. Crush it^^



As i was reading throug the code i found a little problem.

And maybe someone has already found it but it isn´t fixed in the files.



The Destructor of the class Galaxy sets the static variable Instance to null.

If you generate multiple maps short after another this can give a NullPointerException.

But i could not produce a crash ingame. Only via an external map generator.

Just removing the Destructor helps.
0Send private message
12 years ago
Jul 31, 2012, 2:33:01 AM
The bin file in the save game directory is a 7zipped xml file. Please look into the threads here regarding save game editing or search "jailbreak" to find out how to open it.
0Send private message
12 years ago
Jul 31, 2012, 1:27:01 AM
davea wrote:
The save game includes the map in xml. So, if you want to save at turn 0, you can then exit the game, run a program which messes with the xml, and then load the game. The xml contains a number of self-checks, such as a count of all the resources, so this may not be as easy as you think. It would also be easy to accidentally change the xml so that the syntax was legal, but it would cause weird results; for example, strings which cross each other would probably confuse pathfinding.




Where is the map saved? I see Galaxy.xml in install directory "Public/GalaxyGenerator" everytime I generate a new map, but the save directory in "My Documents" contains only a binary .bin file. I've changed Galaxy.xml but the loaded game still contains the original map. Actually even if I load a different saved game that is based on a different map, Galaxy.xml is not changed. It seems to be an output log only, never read.
0Send private message
12 years ago
Jul 30, 2012, 10:51:56 PM
The save game includes the map in xml. So, if you want to save at turn 0, you can then exit the game, run a program which messes with the xml, and then load the game. The xml contains a number of self-checks, such as a count of all the resources, so this may not be as easy as you think. It would also be easy to accidentally change the xml so that the syntax was legal, but it would cause weird results; for example, strings which cross each other would probably confuse pathfinding.
0Send private message
12 years ago
Jul 30, 2012, 10:07:13 PM
Can we get the game to load a map in its XML format? It's much easier to change XML than messing with C# code to get the desirable "random" galaxy.
0Send private message
12 years ago
Aug 23, 2012, 4:14:28 PM
Yup, that's the galaxy generator you could find in the first post, updated and refactored.
0Send private message
?

Click here to login

Reply
Comment