.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   Mod error (http://forum.shrapnelgames.com/showthread.php?t=7990)

Dan C. December 13th, 2002 03:10 AM

Mod error
 
I am working on a mod for SEIV:Gold and I have run into a strange error. All the datafiles load without any warnings, but when I start a game (say after selecting 2-3 player races, and no NPC's) the program gets to around 50% of player placement and then gives an "Integer Overflow" error popup and stops.

Has anyone seen something like this before? I have changed the facilites, and perhaps it is having trouble selecting facilities for the homeworld? - Actually does anyone know how the program selects which facilities will be used on homeworlds??

Krsqk December 13th, 2002 03:42 AM

Re: Mod error
 
Original facility choice is hardcoded. The game will place 1 facility with the Spaceport ability (if your race requires spaceports), 1 with the Supply Generation ability (i.e., resupply depot), 1 with Space Yard ability, one with organics generation, one with radioactives generation, and then splits the remaining about half and half between minerals production and research production. Of course, with some tricky playing with the abilities, you can tweak what appears on each planet (see Proportions Facility.txt for examples).

capnq December 13th, 2002 10:53 PM

Re: Mod error
 
"Integer Overflow" implies that it's seeing a number somewhere that's bigger than it can handle. Check your modded file for typos involving large numbers.

Dan C. December 13th, 2002 11:09 PM

Re: Mod error
 
Quote:

"Integer Overflow" implies that it's seeing a number somewhere that's bigger than it can handle. Check your modded file for typos involving large numbers.
<font size="2" face="Verdana, Helvetica, sans-serif">Thanks, I looked through but I didn't see any particularly large numbers, but I'll have to look again. The strange thing is that it occura halfway though player placement, not in reading the files in the first place, I assume it is selecting a world, upgrading it to the start conditons and then placing the facilities on the world. I can't think what could be too large a value there...

capnq December 15th, 2002 12:18 AM

Re: Mod error
 
Quote:

I assume it is selecting a world, upgrading it to the start conditons and then placing the facilities on the world. I can't think what could be too large a value there...
<font size="2" face="Verdana, Helvetica, sans-serif">Hmm... That sounds like some kind of cumulative effect. Maybe the problem is coming from the combined total production of several of the same facility on one homeworld going over some limit.

Two common integer limits are 255 (2^8-1) and 65535 (2^16-1); the latter seems more likely in this situation.

Krsqk December 15th, 2002 05:56 AM

Re: Mod error
 
I've had planets producing at least 62K of single resources Last I checked, which was several turns ago. I'll check, but I don't think that's limited.

Suicide Junkie December 15th, 2002 06:43 PM

Re: Mod error
 
Mineral Miner 1's (700) x 100% x Sphereworld (200) = 140,000 resources per turn.

People have built sphereworlds, and filled them up before.

The maximum resource production would have to be something like 16 Million (256^3) or 4 Billion (256^4) or (4x10^9)

Dan C. December 15th, 2002 09:36 PM

Re: Mod error
 
Hmmm, in order to track down this error I took the stock facilities file and put it in place for my mod (after changing all the facility tech requirements to "Hull Constrction x" as the mod has a significantly altered tech tree).

Result? Same error. So what else could it be doing half-way thorough the player placement? I haven't played with planet size or sector type files (or for that matter the sytem/Quadrant data - which would have had a problem during quadrant creation anyways)in fact it has to be one of: CompEnhancement, Components, DefaultColonyTypes, DefaultDesignTypes, DefaultStrategies, Events, (Facility), IntelProjects, RacialTraits, Settings, TechArea or Vechicle size.

I guess I'll have to replace them with the originials one-by-one until I find the culprit...

Dan C. December 15th, 2002 11:36 PM

Re: Mod error
 
Quote:

Originally posted by Dan C.:

I guess I'll have to replace them with the originials one-by-one until I find the culprit...

<font size="2" face="Verdana, Helvetica, sans-serif">There must be something against quoting yourself...
Anyway I finally found the error, and I am explaining this in case anyone else sees this problem.

Replacing the files one-by-one led me to the fact that it was my TechArea.txt file that was in error. So thinking I had some sort of loop I fire up the mod editor by DavidG. So I see that a number of "leads to" techs are not being displayed http://forum.shrapnelgames.com/images/icons/shock.gif So noteing that one tech is a prerequisite for 20 techs per level for 3 levels, I am thinking maybe this is the source of my overflow. I reduce the number down to 5 each, and set the other 15 techs to no-prereq, and nope. http://forum.shrapnelgames.com/image...s/confused.gif But I did find a limit in the mod program that it only displays 20 leads to techs... (must be some sort of internal array limit http://forum.shrapnelgames.com/images/icons/icon9.gif

After much reviewing of the file, dropping pre-reqs, dropping branches of the tree (and all derived components, facilities etc), I see the error. I somehow typed a -1 instead of a 1 for maximum level. This tech was a minor tech (actually Fighter Missiles) not granted at the start of the game, (requiring 7 levels from 3 different techs) but I guess when the program was setting up the initial tech for the players, it hit this level issue and even without the pre-req's it crapped out (better at the beginning than in the middle of a game though). So I don't know why it wasn't caught when the file was initially read in, but there it is.

Fyron December 15th, 2002 11:56 PM

Re: Mod error
 
The game must not check techarea.txt very thoroughly when starting up. http://forum.shrapnelgames.com/images/icons/icon7.gif


All times are GMT -4. The time now is 03:24 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.