Home » Stars! 2.6/7 » The Bar » Stars race wizard habitat ranges advantage points
| |
Re: Stars race wizard habitat ranges advantage points |
Fri, 01 May 2020 08:09 |
|
platon79 | | Chief Warrant Officer 3 | Messages: 185
Registered: February 2004 Location: Norway | |
|
Hi and thanx for the link. There was the links to sirgwains craigstars race wizard for Java, but the links were down. I then found another link to github since he had later published the code on github, but the repository now seemed recently deleted (404). I was able to get a file or two from the repository from google cached pages, but nothing much. I haven't been able to get in contact with sirgwain. Then I saw that Daniel had downloaded the java-files for the racewizard back in 2010, so I contacted him, and as luck would have it, he still had the files. So I now have integrated sirgwains race logic with my race wizard! I have tested it vs real stars, and the results seems promising.. The Humanoids even start on 25 points, which nova did not
PRT/LRT points checks out ok. tech, resources, factories, mines are ok. Immunities combinations ok. Shrinking / extending habitat settings ok. Growth rate calculations ok. Ahh, so close... BUT, when I start adjusting the hab values left or right, small discrepancies start showing up at once
Anyone who knows if all attempts to recreate the race wizard has failed over the years, and good approximations are all we have?
Or does someone has the perfect code hidden away somewhere?
Report message to a moderator
|
|
|
Re: Stars race wizard habitat ranges advantage points |
Fri, 01 May 2020 09:31 |
|
raptor | | | Messages: 138
Registered: June 2014 | |
|
I don't know if this will help, but I used IDA to disassemble Stars! and then exported it to Ghidra to use its free decompiler. Below is the resulting code from the race wizard page 4, which may provide some insights for the pesky point calculations:
word __stdcall16far
RaceWizardDlg4(int param_1,int param_1_00,int param_3,uint param_4,int param_5,undefined2 param_6)
{
undefined2 uVar1;
undefined *puVar2;
int iVar3;
undefined *puVar4;
int unaff_SI;
RECT *pRVar5;
word *pwVar6;
byte local_292;
word local_3a;
word local_38;
RECT local_36;
word local_2e;
PAINTSTRUCT local_2c;
word local_c;
RECT local_a;
if (param_4 == 0xf) {
uVar1 = BEGINPAINT();
GETCLIENTRECT();
_DrawRaceAdvantagePoints();
SELECTOBJECT();
SETBKCOLOR();
GETDLGITEM();
GETWINDOWRECT();
SCREENTOCLIENT();
GETDLGITEM();
GETWINDOWRECT();
pwVar6 = &local_a.right;
SCREENTOCLIENT();
local_36.right = local_a.right;
local_36.bottom = local_a.bottom;
_ExpandRc(&local_36,(int *)(_dyArial8 + 2),(int)_dyArial8 >> 1,(int)pwVar6);
local_36.top = local_36.top - 4;
__Draw3dFrame(uVar1,&local_36,(word *)0xffff,(int)pwVar6);
_CchGetString(0x112,(uint)&_szWork,(undefined *)pwVar6);
TEXTOUT();
GETCLIENTRECT();
local_a.top = local_36.bottom + 0xc;
local_a.left = local_a.left + 0xc;
local_a.right = local_a.right - 0xc;
GETDLGITEM();
GETWINDOWRECT();
pRVar5 = &local_36;
SCREENTOCLIENT();
local_a.bottom = local_36.top - 6;
__Draw3dFrame(uVar1,&local_a,(word *)0xffff,(int)pRVar5);
puVar2 = _CchGetString(0x113,(uint)&_szWork,(undefined *)pRVar5);
TEXTOUT();
iVar3 = _GetRaceStat((int)&_vplr,0xe,(int)puVar2);
local_3a = (iVar3 + 0x5c) * 3;
local_38 = 0;
local_c = 0;
while ((int)local_c < 3) {
puVar4 = _CchGetString(local_3a,(uint)(&local_292 + local_38),puVar2);
local_38 = (word)(puVar4 + local_38);
local_c = local_c + 1;
local_3a = local_3a + 1;
}
_ExpandRc(&local_a,(int *)(-2 - _dyArial8),-((int)_dyArial8 >> 1),(int)puVar2);
local_a.top = local_a.top + 4;
DRAWTEXT();
_rcCargo = local_a.left;
WORD_b6c9_23a0 = local_a.top;
WORD_b6c9_23a2 = local_a.right;
WORD_b6c9_23a4 = local_a.bottom;
ENDPAINT();
}
else {
if (param_4 == 0x14) {
GETCLIENTRECT();
FILLRECT();
}
else {
if (param_4 == 0x19) {
local_c = 0x10f;
while (((int)local_c < 0x119 && (iVar3 = GETDLGITEM(), iVar3 != param_1))) {
local_c = local_c + 1;
}
if ((0x118 < (int)local_c) && (param_1_00 != 6)) {
return 0;
}
SETBKCOLOR();
return 0;
}
if (param_4 == 0x110) {
_SetRCWTitle();
iVar3 = _GetRaceStat((int)&_vplr,0xe,0x118);
iVar3 = iVar3 + 0x10f;
CHECKRADIOBUTTON();
if (_fRCWReadOnly != 0) {
local_c = 0x10f;
do {
GETDLGITEM();
ENABLEWINDOW();
local_c = local_c + 1;
} while ((int)local_c < 0x119);
}
_StickyDlgPos(param_5,(int)&_ptStickyRaceDlg,(word *)&UNK_b6c9_0001,iVar3);
}
else {
if (param_4 != 0x111) {
return 0;
}
if (param_3 == 0x76) {
WINHELP();
}
else {
local_c = 0;
while (((int)local_c < 4 && (*(int *)((int)&_rgidRaceBtn + local_c * 2) != param_3))) {
local_c = local_c + 1;
}
if (3 < (int)local_c) {
if (param_1_00 != 0) {
return 0;
}
if ((uint)param_3 < 0x10f) {
return 0;
}
if (0x118 < (uint)param_3) {
return 0;
}
_SetRaceStat((int)&_vplr,0xe,param_3 + -0x10f,unaf
...
Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Thu Jun 06 02:12:42 EDT 2024
|