Home » Stars! 2.6/7 » The Bar » My Stars! Epiphany.
My Stars! Epiphany. |
Sun, 03 May 2020 09:19 |
|
platon79 | | Chief Warrant Officer 3 | Messages: 185
Registered: February 2004 Location: Norway | |
|
My Stars! Epiphany.
Some weeks ago, I was reading about raptos disassembly project, and then rereading my old Stars3 thread, realising that even with the original source kode of stars, tweaking the original game is an almost impossible task, and without the source code, it is hopeless.
It is too bad it will never be a Stars jrc5 or the like. Then I started thinking some, and some more. And eventually I had a small Epiphany. It might not work at all, but if it works, it would be very cool (at least in my opinion).
Ok, my thinking went something like this: We all love Stars, there will probably never be a new stars version. No additional bug fixes (maybe an x-file sanitizer though), and no tweaking/balancing of existing gameplay.
Regarding the balancing issues, there is a lot of fun stuff in stars already that is never used due to it costing too many or two few points. Eg CA is usually banned, AR is usually too weak, GR, UR, MA is usually not worth it, who in their right minds picks BE? etc.
If the race wizard could be tweaked, then it could reintroduce a lot of fun gameplay. Hmm, as we know, the computer players does not cheat, except that they play races with negative advantage points. Hm, I wonder if stars therefore only checks for negative advantage points in the race wizard, and not during gameplay?
What would the consequences of the latter be? The stars encryption algorithm for the file blocks has been in the open for some years. If I designed a standalone race wizard, and managed to understand all the blocks in the race file, then I could in theory write a race file with negative points. IF this race file is then accepted in Stars, like the computer players, it would open up quite a few possibilities..
If such an approach is possible, then I would propose the following:
-Step 1: Recreate the stars race wizard as a standalone application that exactly matches the advantage points left of the original stars.
-Step 2: Create additional rule sets that tweaks the game, where points are added/subtracted according to rules in this ruleset after the original points are calculated.
-Step 3: Validate the race file vs points towards the ruleset, instead of the original points.
-Step 4: Write the race file (May have negative points in Stars!)
-Step 5: When a new game is created, as long as all the players use the same version of the RaceBuilder app, and the same ruleset, the host then just have to validate each race he is sent in his own RaceBuilder app.
Step 4 may take some time to figure out, but I have already started on step 1 ( https://starsautohost.org/sahforum2/index.php?t=msg&th=5 650&start=0&rid=0 ) and hopefully will get the code correct for the original points soon.
I think a standalone race wizard that could save the race based on another rule set would open up for a lot of very interesting things, and open up for existing traits and gameplay that is normally never used.
If someone already knows that stars validates the race files an additional time before starting the game, then please stop me now, but if not..
Just think about it. If you want, you can come with suggestions for the standard new rule set here in this thread.
Just think how fun it would be.
"Hmm, BE sucks, everyone knows this. Hmmmm, it gives me a lot more points than usual? Maybe I should try it this time and try to live with it. I really need those points."
"Wow, AR gave me that many additinal points? I want to see if I can survive with an AR with these rules then".
"Hmm, CA is now allowed? But that was quite a lot of negative points for selecting it. Let's see what we would have to do..
"Wow, MA and UR was cheaper than before, I want to try it this time! Should I also try CE? That also gives me more points than normal, but it is risky.."
Of course, the rule set could also incorporate eg validations ala no "No advanced scanners" for Joat, or other stuff.
There could also be played scenarious with rulesets ala "Battle of the Titans - Super races" where a
...
Report message to a moderator
|
|
|
Re: My Stars! Epiphany. |
Sun, 03 May 2020 11:52 |
|
ricks03 | | | Messages: 222
Registered: January 2012 Location: NC | |
|
There are already x-file sanitizer programs. Mine detects for Colonizer, 10th Starbase, Spacedock, and Cheap Starbase for example My code can also tell when a player fixes it in the .x file on a subsequent upload (well, except for Cheap Starbase, that one is proving tricky), and can also fix the problem inside the file arbitrarily. That functionality is built into my hosting program. I think it's important to stamp out those issues because, regardless of how cool race design can be, if you can't be fairly certain other players aren't cheating the game is a lot less fun. So mapping out those remaining blocks that are tied to core Stars! bugs (e.g. BattlePlan Block, the Unload Task blocks, the Fleet Move/Split/Merge) would have more impacts.
There are already tools that let you redesign and reallocate points for things ...
I think you'd have an easier path by simply modifying the races in the .hst file post-game creation. Then they'd be permanently changed, and I'd bet Stars! never revalidates them. You could do that off of a game of default humanoids; just modify everything to what you wanted.
The race data itself is, I think, completely understood. I can already read (and display) the information out of a .r file (thanks to Raptor's work), and modify everything in it, including password. So that's possible now.
You can see Raptor's work on Race here: https://github.com/stars-4x/starsapi/blob/master/src/main/ja va/org/starsautohost/starsapi/block/PlayerBlock.java
and my translation of that is here: https://github.com/ricks03/TotalHost/blob/master/scripts/Sta rsRace.pl [interesting, AH breaks the URL with a space for the .pl file]
If you're redesigning the race wizard points, you don't HAVE to completely understand how they're assigned now, right? You can just be close (or not!).
You can also accomplish almost exactly what you want with no coding within a handicapping system. Pick an arbitrary amount of points that must be left over in the race wizard and use handicapping.
Example: 50 points must be left over.
-JoaT can only take No Advanced Scanners if they also take an additional 95 pt penalty.
-Interstellar Traveler additional 50 pt penalty
-Alternate Reality additional 50 pt bonus
So a JOAT would have to have 145 points left over, an IT 100, and an AR 0.
[Updated on: Sun, 03 May 2020 11:54]
https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHostReport message to a moderator
|
|
| | | |
Re: My Stars! Epiphany. |
Sun, 03 May 2020 14:48 |
|
platon79 | | Chief Warrant Officer 3 | Messages: 185
Registered: February 2004 Location: Norway | |
|
ricks03 wrote on Sun, 03 May 2020 11:52There are already tools that let you redesign and reallocate points for things ...
Which tools are these?
ricks03 wrote on Sun, 03 May 2020 11:52If you're redesigning the race wizard points, you don't HAVE to completely understand how they're assigned now, right? You can just be close (or not!).
No I don't have to, but would very much like to
ricks03 wrote on Sun, 03 May 2020 11:52You can also accomplish almost exactly what you want with no coding within a handicapping system. Pick an arbitrary amount of points that must be left over in the race wizard and use handicapping.
Yes, but that makes all races a little bit worse, and would not work well with LRT tweaking. I want to have an easy to use race designer that can do whatever people like to do regarding point distribution, and I don't want people to constantly go to the game page and check "what was the handicapping rules again?"
For a new game, I want the host to be able to just say, "Download the RaceWizard from https://github.com/stars-4x/starsapi/releases/tag/RaceWizard _0.1.jar , select ruleset nr 2 in the dropdown, and save and submit the race to me."
Yes, you can actually follow that link, I just published my current version of the RaceWizard to illustrate how I'd like this to be Much better than explaining it in text I guess.
ricks03 wrote on Sun, 03 May 2020 11:52The race data itself is, I think, completely understood. I can already read (and display) the information out of a .r file (thanks to Raptor's work), and modify everything in it, including password. So that's possible now.
If you have the time, could you perhaps quickly just write a race file with negative points just to see if it loads in Stars?
ricks03 wrote on Sun, 03 May 2020 12:18What could be interesting is a game where you're allowed to design races with no points limit at all. . .
That's just making a ruleset with a high enough point value...
Btw, magic9mushroom, we could have different rulesets based on if the game is AccBBS or not.
[Updated on: Sun, 03 May 2020 14:50] Report message to a moderator
|
|
| |
Re: My Stars! Epiphany. |
Sun, 03 May 2020 16:23 |
|
ricks03 | | | Messages: 222
Registered: January 2012 Location: NC | |
|
Tools from back in the day. StarsPlayerEditor is a name that looks right from my old tools folder. Verker's VML would be another.
I also have an excel spreadsheet that looks like it has all the race math in it...
I don't see why it doesn't work with LRT tweaking? Any math you have to do for a wizard you can do from a practical perspective: (+95 for NAS, +105 for NAS and 4 other LRTs). Any complex interaction you want to do otherwise you have to write the code for anyway, so it's just the same math with less debugging
StarsRace.pl will pull that data out for you. I did just give a try to reading a race in, and then pushing it back out without changing it. That I can do. But I'm corrupting the file somewhere when I change other bytes in it. I recall I can't change the password in a .r file either even though I can reset it in .m, .hst, and .x files. I think it's tied to the same thing that causes race file corruption. Sorry. After I change a .r file in any way stars reports it as corrupt.
My personal project is a hosting program that detects, warns, and corrects for bugs. If you have the time to map some of the stars! blocks and update the data in Stars-4X? My priority is fixing the things that are significant known bugs (esp. those hard to detect), and for that I need mapped blocks. In particular at the moment the Load/Unload task blocks to correct for the Mineral upload and FreePop. I'm working on breaking out the BattlePlan block now to solve for Friendly Fire.
[Updated on: Sun, 03 May 2020 16:25]
https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHostReport message to a moderator
|
|
| | |
Re: My Stars! Epiphany. |
Mon, 04 May 2020 01:25 |
|
magic9mushroom | | Commander | Messages: 1361
Registered: May 2008 | |
|
ricks03 wrote on Mon, 04 May 2020 02:18What could be interesting is a game where you're allowed to design races with no points limit at all. . .
Not really. Everyone takes this race:
HE
IFE, ISB, UR, MA, NRSE, OBRM, RS
3i 20%
1/700 15/5/25/3g 25/2/25
All cheap
(-12297 points)
I guess you could fiddle around with NRSE and NAS, and changing PRT's at least theoretically an option even if the HE will basically always win, but all other options have a clear "optimum" if you don't consider the points.
ricks03 wrote on Mon, 04 May 2020 06:23StarsRace.pl will pull that data out for you. I did just give a try to reading a race in, and then pushing it back out without changing it. That I can do. But I'm corrupting the file somewhere when I change other bytes in it. I recall I can't change the password in a .r file either even though I can reset it in .m, .hst, and .x files. I think it's tied to the same thing that causes race file corruption. Sorry. After I change a .r file in any way stars reports it as corrupt.
The issue is, as raptor said, the checksum. To check for race file corruption or hacking the game makes a number which depends on all the settings, and if recalculating it from the actual settings doesn't match it rejects it as corrupt.
This is the source of the "changing race name results in corruption" bug, as the game forgets to change that number when you change the race name (assuming you didn't change anything else) but the race name is part of what determines said number (so they don't match anymore).
Report message to a moderator
|
|
|
Re: My Stars! Epiphany. |
Mon, 04 May 2020 02:07 |
|
ricks03 | | | Messages: 222
Registered: January 2012 Location: NC | |
|
magic9mushroom wrote on Mon, 04 May 2020 01:25
Not really. Everyone takes this race:
...
I guess you could fiddle around with NRSE and NAS, and changing PRT's at least theoretically an option even if the HE will basically always win, but all other options have a clear "optimum" if you don't consider the points. I wasn't suggesting the race design was in any way not obvious. Just that it would be interesting to have everyone on such extreme but equal footing.
ricks03 wrote on Mon, 04 May 2020 06:23StarsRace.pl will pull that data out for you. I did just give a try to reading a race in, and then pushing it back out without changing it. That I can do. But I'm corrupting the file somewhere when I change other bytes in it. I recall I can't change the password in a .r file either even though I can reset it in .m, .hst, and .x files. I think it's tied to the same thing that causes race file corruption. Sorry. After I change a .r file in any way stars reports it as corrupt.
magic9mushroom wrote on Mon, 04 May 2020 01:25The issue is, as raptor said, the checksum. To check for race file corruption or hacking the game makes a number which depends on all the settings, and if recalculating it from the actual settings doesn't match it rejects it as corrupt. I'll perhaps suggest that explaining what a checksum is might be a bit over the top. I'm familiar with both the concept, and the issue. I just hadn't dealt with it in many years, so forgive me for not remembering the specifics off the top of my head when trying to just quickly kick out code for someone asking for a favor. . .
https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHostReport message to a moderator
|
|
|
Re: My Stars! Epiphany. |
Mon, 04 May 2020 06:38 |
|
magic9mushroom | | Commander | Messages: 1361
Registered: May 2008 | |
|
ricks03 wrote on Mon, 04 May 2020 16:07magic9mushroom wrote on Mon, 04 May 2020 01:25
Not really. Everyone takes this race:
...
I guess you could fiddle around with NRSE and NAS, and changing PRT's at least theoretically an option even if the HE will basically always win, but all other options have a clear "optimum" if you don't consider the points. I wasn't suggesting the race design was in any way not obvious. Just that it would be interesting to have everyone on such extreme but equal footing.
I suppose it'd be kinda the opposite of a Stone Age Slog.
Quote:I'll perhaps suggest that explaining what a checksum is might be a bit over the top. I'm familiar with both the concept, and the issue. I just hadn't dealt with it in many years, so forgive me for not remembering the specifics off the top of my head when trying to just quickly kick out code for someone asking for a favor. . .
Well, sorry I guess? Checksums aren't exactly common knowledge, and it had already been mentioned in the thread, so I thought you might not know what they were. Was trying to help.
Report message to a moderator
|
|
| | | |
Re: My Stars! Epiphany. |
Tue, 05 May 2020 02:46 |
|
ricks03 | | | Messages: 222
Registered: January 2012 Location: NC | |
|
don't know if it will be useful or not...
In untangling the Spacedock bug, the amount of armor on the ship is one of the variables stored in the design block. I had hoped that I could just update the armor value (to, say 32,760). But it didn't work to change it in the .x file, because the host program apparently recalculated the value before storing it. I had to actually change the design to get it to work.
The Player block doesn't even include the score. So it seems likely that even if you can mangle a .r file, that the initial calculation is redone in the host.
On the other hand, the race block is also the only one I think with a checksum. so maybe it's not protected otherwise.
So I tried modifying the race block inside the .hst file. Interesting. When I open the .HST file, the Host Mode GUI says
#1 The Humanoids are still out --- HACKER
When I generate a turn, and look at the .M file, I get a message: "Your race definition has been tampered with. Statistics have been altered to bring you into compliance with the cosmic code. "
Hah!
That's a different result than I expected. I modify the race data block once the game is up-and-running (at least in the context of resetting the password in the .m, .hst., and .x files), in a way that I can't when trying to modify the .r file. I've never cared before about any other modification. But it can clearly tell when something changes. I wondered/hoped that might give me one of the never-identified blocks, but it didn't, so that HACKER flag is either set in the Player block, or I didn't quite get the data back correctly, and it shows up upon a recalculation fo score. *shrug*.
Rick
(If you want the script that can change bytes in the player block let me know)
[Updated on: Tue, 05 May 2020 02:58]
https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHostReport message to a moderator
|
|
| | |
Re: My Stars! Epiphany. |
Tue, 05 May 2020 10:31 |
|
ricks03 | | | Messages: 222
Registered: January 2012 Location: NC | |
|
magic9mushroom wrote on Tue, 05 May 2020 08:48Have you tried just hacking around the code that won't let you save if the balance is negative? That way, however the checksum goes, it should still be correct for the race.
(The issue then is whether Stars! runs a check for illegal races. This isn't beyond the realm of plausibility.) While I can work with changing the block information, I don't have a way to modify the .exe itself.
From my notes above, I don't think the checksum comes into play when modifying the .HST, .M, and .X file (because I can modify the password in those files, where I can't in the .R file). So I suspect you'd not only have to prevent saving a race file with a negative balance, you'd also have to disable a check on turn generation.
https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHostReport message to a moderator
|
|
|
Re: My Stars! Epiphany. |
Tue, 05 May 2020 10:53 |
|
magic9mushroom | | Commander | Messages: 1361
Registered: May 2008 | |
|
ricks03 wrote on Wed, 06 May 2020 00:31magic9mushroom wrote on Tue, 05 May 2020 08:48Have you tried just hacking around the code that won't let you save if the balance is negative? That way, however the checksum goes, it should still be correct for the race.
(The issue then is whether Stars! runs a check for illegal races. This isn't beyond the realm of plausibility.) While I can work with changing the block information, I don't have a way to modify the .exe itself.
From my notes above, I don't think the checksum comes into play when modifying the .HST, .M, and .X file (because I can modify the password in those files, where I can't in the .R file). So I suspect you'd not only have to prevent saving a race file with a negative balance, you'd also have to disable a check on turn generation.
If you edit a race in the .hst/.m/.x, but don't give it a negative balance, does this result in a HACKER flag? If so, there's something else going on that doesn't necessarily imply a check for racefile legality. If not, then it's a check for nonnegative balance and outside of involved .exe hacking there's no way to fix it.
(Are you sure that the .hst doesn't keep both the original password (for the race checksum) and the current password (for Change Password) in separate locations? That could explain the password results, if you were only modifying the current password.)
Report message to a moderator
|
|
|
Re: My Stars! Epiphany. |
Tue, 05 May 2020 11:32 |
|
ricks03 | | | Messages: 222
Registered: January 2012 Location: NC | |
|
magic9mushroom wrote on Tue, 05 May 2020 10:53If you edit a race in the .hst/.m/.x, but don't give it a negative balance, does this result in a HACKER flag? If so, there's something else going on that doesn't necessarily imply a check for racefile legality. If not, then it's a check for nonnegative balance and outside of involved .exe hacking there's no way to fix it. Yes, I know. I think I'm just going to go with ... patience grasshopper. I'm simply posting results as I puzzle things out. OK?
magic9mushroom wrote on Tue, 05 May 2020 10:53(Are you sure that the .hst doesn't keep both the original password (for the race checksum) and the current password (for Change Password) in separate locations? That could explain the password results, if you were only modifying the current password.)
I have fairly well mapped out the password in all the files, how it's passed back and forth, and where to change it to remove/replace it. The password I'm changing is clearly included in the checksum evaluation (because I can't change it in the .r, and can in the others).
This might be a worthy endeavor, but it's not where my interests are. I'm deep in finding and fixing Stars! bugs, and just happened to have related code that I thought might provide quick insights. I appreciate your enthusiasm tho; I'll be glad to give you the tools to pursue your own investigations.
[Updated on: Tue, 05 May 2020 11:54]
https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHostReport message to a moderator
|
|
| |
Re: My Stars! Epiphany. |
Sat, 09 May 2020 05:32 |
|
platon79 | | Chief Warrant Officer 3 | Messages: 185
Registered: February 2004 Location: Norway | |
|
Hi again. I have now done some testing, and I am sad to report, it seems my original dream is dead. Here is my findings.
It seems to me the checksum you were talking about is in the FileFooterBlock. I therefore made a lot of different r1-files in the stars race wizard, where the only change between files were the growth rate, which I set at all the different values.
Based on these files, I was able to see the pattern in the checksum for this one file. (Another file I tried would give another pattern, I did not try to find out how to generate the checksum at this point, as that would be quite another monster.)
So, after finding out this pattern, Based on reading in the default 19% race with 0 points left, I then wrote two race files via the starsapi project, one with 18% and one with 20% growth rate, and modifying the checksum in the FileFooterBlock to match the pattern while writing the files.
Both of these files are now accepted as non-corrupted files in Stars, they both open fine in the stars race wizard, the 18% race showing 65 points left and the 20% race showing -125 points left.
When I start a new game with the 18% race, everything is fine. Playing a turn does not trigger any hacker flag or anything.
When I start a new game with the 20% race, the race seems to be REPLACED with the default Humanoid-race, with a random name.
So apparently there IS a check at startup checking for negative points (at least for human players), that just replaces the race with humanoids if below zero points left.
Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Mon May 13 06:37:54 EDT 2024
|