The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Elegnaim on January 02, 2006, 02:26:59 am



Title: Modding the source code/time limit?
Post by: Elegnaim on January 02, 2006, 02:26:59 am
Not entirely sure this is the right forum, although the descriptor mentioned the source code probs.

Okay, because me and a few friends are A) really bored. B) not fond of the time limit, we figured that, for our own amusement and *education*, we'd try and alter the source code to change the way the time limit/in game time works. For, like, our own personal copies.

Anyway, so I had a few questions. I'm assuming that clock.h and clock.c handle time update functions. One of our ideas was just to slow down in-game time passage (make days ten times longer or something) to lower the time limit. While I can find month, year, and... well, leap year handlage in clock.c, I can't find any section that deals with the length of DAYS. What source should we be looking in for this?

Ah, what else... we also thought about just setting the time limit to ten years. Reading gameev.c, it mentions a KOHR_AH_GENOCIDE event, and another one for black ur-quan. I'm assuming these are related to the time limit? Wondering if this is what stores the time limit, or if that's the time_til_kohr_ah_victory one (can't recall the exact name!)

Alternatively, would it be possible to just change the start year? I'm not really sure if the time limit is based on years ELAPSED or on some sort of year variable hitting 2459 (is that the right  year? :P)


Title: Re: Modding the source code/time limit?
Post by: meep-eep on January 02, 2006, 02:59:21 am
I think this (http://uqm.stack.nl/forum/index.php?topic=1699.msg21457#msg21457) is what you're looking for.


Title: Re: Modding the source code/time limit?
Post by: Elegnaim on January 02, 2006, 05:07:21 am
Ah, good. Good. I got everything to start building properly. However, I've picked up a source code error along the way.

src/sc2code/load.c: In function `LoadGame':
src/sc2code/load.c:198: `KOHR_AH_VICTORIOUS_EVENT' undeclared (first use in this function)

Now, KOHR_AH_VICTORIOUS_EVENT is declared in gameev.h. The post you linked to makes no mention of needing to include that. Should I, or is there some other thing I must do?


Title: Re: Modding the source code/time limit?
Post by: meep-eep on January 02, 2006, 05:34:26 am
Just include it. It probably wasn't necessary when I wrote that post originally, but we've cleaned up the includes a bit since then.


Title: Re: Modding the source code/time limit?
Post by: Elegnaim on January 02, 2006, 07:34:13 am
Hey, thanks. Everything worked perfectly. I also set the clock FPS thing to 80. Hope that didn't break anything. It makes time progress a little over 3x as slowly, though, which is pretty much the exact effect I wanted.

Granted, this also makes it the first time I've ever used MSYS, or compiled a complex project. God, education rocks XD

---edit---

Okay, I realized I don't have that dosbox in the background listing... stuff. Was that essential? Is this because I compiled without debug information?


Title: Re: Modding the source code/time limit?
Post by: meep-eep on January 03, 2006, 12:40:42 am
Yes. If you've chosen for a debug build, you won't have the debug information nor the console window.


Title: Re: Modding the source code/time limit?
Post by: Kohr-Ah Death on January 03, 2006, 10:44:35 am
Hey, thanks. Everything worked perfectly. I also set the clock FPS thing to 80. Hope that didn't break anything. It makes time progress a little over 3x as slowly, though, which is pretty much the exact effect I wanted.

Granted, this also makes it the first time I've ever used MSYS, or compiled a complex project. God, education rocks XD

---edit---

Okay, I realized I don't have that dosbox in the background listing... stuff. Was that essential? Is this because I compiled without debug information?

congrats on the compilation, i used MS Visual Studio . NET 2003 the first time around and i only had experience in QBasic, so i had to do some really fast learning before i modified anything.

Now i have visual studio 2005 and am modding lots of other things now ;D

my version of the time fix and many other things can be found at my website.