Stunts Forum

Stunts - the Game => Stunts Chat => Topic started by: Daniel3D on September 15, 2021, 12:38:59 PM

Title: Programming help wanted.
Post by: Daniel3D on September 15, 2021, 12:38:59 PM
Hi guys.

As many of you have noticed, I'm full of ideas
But I lack the skills to do it all myself.

So far I have been leaning on CAS for the majority of the programming and code changes but he is quite busy and I want to give him some breathing room.

For the new release of stunts he has written a new setup program. Setup of video and sound works exactly like the original.

But an installation function is not available yet.
Also there are some things I would like to add.
Most importantly a car manager/swapper.

Who can help with adding the additional functionality?
It's currently written in quickbasic.
Source code is available.

Thanks in advance.
Daniël
Title: Re: Programming help wanted.
Post by: Cas on September 19, 2021, 01:11:51 AM
I really would like to have more time to concentrate in giving you a hand with that, Daniël. Sometimes I do have some free time, but if I've been working recently, I feel so tired of being at the computer that I only feel like doing things that don't require much concentration. I hope with time I find the way to not feel so tired after work, maybe when I get the hang of it to the point of becoming a pretty automatic thing. But yes, I'll try to do some programming from time to time. I don't want to just stop doing it.
Title: Re: Programming help wanted.
Post by: Daniel3D on September 19, 2021, 10:34:42 AM
It's frustrating not to be able to do it myself. And knowing you are very busy. Don't want to pressure you, but want to move forward to
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 10:20:23 AM
Quote from: Daniel3D on September 15, 2021, 12:38:59 PM
Who can help with adding the additional functionality?
It's currently written in quickbasic.
Source code is available.

at first it should be very clear/excat what should be the result - there are many different ideas in the other thread (http://forum.stunts.hu/index.php?topic=3823.msg81568#new) about how car swapping should work

so a clear list of needed features and how they should work exact would be a good start - a tool that every (relevant) community member is ok with would be great

and i though Cas is using FreeBasic (qbasic is something totaly different), or am i wrong?
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 11:47:41 AM
Quote from: llm on September 21, 2021, 10:20:23 AM
so a clear list of needed features and how they should work exact would be a good start - a tool that every (relevant) community member is ok with would be great

I think can provide that. Except that it may not be possible to please every (relevant) community member. But a majority is my goal.
I also aiming at creating a better (in a sense) version that new players are comfortable with.

Quote from: llm on September 21, 2021, 10:20:23 AM
and i though Cas is using FreeBasic (qbasic is something totaly different), or am i wrong?
As CAS put it.
QuoteSetup is to simple tp be made in FreeBasic. It's like using a Jumbo jet to take ten kids to school
Qbasic is very suitable for that.

But any aditional feature can be made as stand alone progam and be called by setup. So Qbasic is optional.
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 11:58:43 AM
It still needs an Installer function.
The game directory has variable contents and subdirectories. (custom content and mods)
Installation can be form or to a removable medium. (basically from any location to any location)
So,
It needs to check if the source directory contains game files and if the destination exists.
Create a directory if needed.
Copy the whole, including subdirectories, to the new location.
[this part just mimics the functions of the original installer]

Optional features
(re)Install the base game without additional content and modifications.
* (needs a file list of the base game with mandatory and optional files so it doesn't choke on a missing track or highscore file)
Install the game in the new location with selected modifications.
* (needs to be able to identify cars, tracks and tools and provide checkboxes to include them)
(de)Install modifications to current installation
* (needs to be able to identify cars and tracks and provide checkboxes to move them to and form the main game from any location)
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 12:11:44 PM
A car manager.
To install new cars, it could call upon the installation feature above if available, or it needs a similar function build in.
Needs to be able to move cars from showroom to storage and back.
* (except for the default car, that can not be removed from the showroom because that breaks the game)
An option to save showroom configuration to restore back to (example competition 2022 car set).

A graphic of render of the CAR selected with car information. I really need that, and I think that would look better.
A 3D render can not be done in Qbasic, so Freebasic or whatever you like would be necessary. A picture can be done easier, I don't mind providing 100 pictures.
Metadata to classify cars is probably handy. Again, I don't mind filling in the blanks for 100 cars.
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 01:30:10 PM
Quote from: Daniel3D on September 21, 2021, 11:47:41 AM
Quote from: llm on September 21, 2021, 10:20:23 AM
and i though Cas is using FreeBasic (qbasic is something totaly different), or am i wrong?
As CAS put it.
QuoteSetup is to simple tp be made in FreeBasic. It's like using a Jumbo jet to take ten kids to school
Qbasic is very suitable for that.

But any aditional feature can be made as stand alone progam and be called by setup. So Qbasic is optional.

that makes no sense

why should one use a several decades old QBasic interpreter(or are with talking about the decades old "QuickBasic" compiler?)
when FreeBasic is able to produce small, standalone pure dos executables? and what means "Qbasic is optional"?
or are the FreeBasic dos executeables too big?
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 01:37:17 PM
Quote from: llm on September 21, 2021, 01:30:10 PM
that makes no sense

why should one use a several decades old QBasic interpreter(or are with talking about the decades old "QuickBasic" compiler?)
when FreeBasic is able to produce small, standalone pure dos executables? and what means "Qbasic is optional"?
or are the FreeBasic dos executeables way bigger?

Again, quoting CAS on this.
QuoteIf you just make a "Hello world" program, it'll take some 30K in QuickBasic and 300K in FreeBasic

I don't know how easy it is to create the same look and feel in freebasic.
But the Qbasic setup looks exactly like the original.

and we are talking about the decades old "QuickBasic" compiler i believe. Because CAS mentioned running it in DOSBox  ;D
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 01:58:14 PM
Quote from: Daniel3D on September 21, 2021, 01:37:17 PM
I don't know how easy it is to create the same look and feel in freebasic.
But the Qbasic setup looks exactly like the original.

and we are talking about the decades old "QuickBasic" compiler i believe. Because CAS mentioned running it in DOSBox  ;D

look and feel should be also easy in freebasic (textmode programming is super easy)
i think freepascal or C would be better for getting more people in then using decades old basic compilers - but better then nothing AND good work Cas!

and size is a strange decision base if you prepare a package that is larger then ever
Cas seem to always strive for the extreme - even if it has no relevance :)

btw: qbasic means the interpreter - if you want to find people then don't ask for qbasic programmers - most of them would rather use C or pascal
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 02:01:24 PM
btw: could Cas 3D Engine be used for showing images of the cars in the new car swapper/garage thing?
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 02:13:06 PM
Quote from: llm on September 21, 2021, 02:01:24 PM
btw: could Cas 3D Engine be used for showing images of the cars in the new car swapper/garage thing?
Yes, but that might be overkill.
The 3D view in carworks would work to. No wheels but that is irrelevant.

CAS has his own take on matters. Quite complex and part of his personality. It restricts him but makes his work also special in a way.
Frustrating to work with sometimes. But the adaptations to the game for the Ferrari edition we did together in 5 hours..

Any code that can be run in DOS may be used.
As long as a 386 can run it, I'm happy.
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 02:25:15 PM
Quote from: Daniel3D on September 21, 2021, 02:13:06 PM
But the adaptations to the game for the Ferrari edition we did together in 5 hours..

you two should do a Podcast :)
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 02:39:05 PM
Quote from: llm on September 21, 2021, 02:25:15 PM
Quote from: Daniel3D on September 21, 2021, 02:13:06 PM
But the adaptations to the game for the Ferrari edition we did together in 5 hours..

you two should do a Podcast :)
Well, it was a lot of fun.
I was browsing the assembly code and throwing bits I found his way. He looked it up in the gamefile and directly edited the binary.
Meanwhile I created the graphics and in a few tests we had it working.
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 02:45:55 PM
Quote from: Daniel3D on September 21, 2021, 02:39:05 PM
I was browsing the assembly code and throwing bits I found his way. He looked it up in the gamefile and directly edited the binary.

are there any code -  or only resource (graphics etc.) changes?
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 03:12:50 PM
Quote from: llm on September 21, 2021, 02:45:55 PM
Quote from: Daniel3D on September 21, 2021, 02:39:05 PM
I was browsing the assembly code and throwing bits I found his way. He looked it up in the gamefile and directly edited the binary.

are there any code -  or only resource (graphics etc.) changes?
The code changes are only the coordinates of the main menu buttons and the default car (hard coded in several locations) because the countach doesn't belong in a Ferrari lineup.
The rest is resources.

I would like the code changes in the new executables as well. To get a clean Ferrari version.
Title: Re: Programming help wanted.
Post by: llm on September 21, 2021, 03:29:04 PM
Quote from: Daniel3D on September 21, 2021, 03:12:50 PM
I would like the code changes in the new executables as well. To get a clean Ferrari version.

should be easy if the file-offsets are known

building from asm source will only work for the MCGA exe - the other vesions are not reversed currently
Title: Re: Programming help wanted.
Post by: Daniel3D on September 21, 2021, 04:17:59 PM
Quote from: llm on September 21, 2021, 03:29:04 PM
Quote from: Daniel3D on September 21, 2021, 03:12:50 PM
I would like the code changes in the new executables as well. To get a clean Ferrari version.

should be easy if the file-offsets are known

building from asm source will only work for the MCGA exe - the other vesions are not reversed currently
The offset of the menu buttons is easy to find.
The default car is a bit more complicated.
CAS created a little program to find them all.
Although I am quite certain that I can find them all.
Title: Re: Programming help wanted.
Post by: Cas on September 23, 2021, 11:39:46 PM
The program, I have somewhere if anybody needs it, but the algorithm is very simple:

You give the program a four-letter string. The program looks up the first letter. When it finds it, it tries to find the second letter among the first few bytes after the place where the first letter was found. If it doesn't find it, it continues; if it does find it, it counts how many bytes after the first letter came the second and say that is x; then it checks x bytes beyond and 2x bytes beyond to see if the the third and fourth letters are there. If they are, then the string has been found. If they aren't, then it hasn't. If found, location is printed. The algorithm continues until the end of the file.
Title: Re: Programming help wanted.
Post by: llm on September 24, 2021, 06:32:58 AM
First it sounds like an ordinary hex editor search giving the offset of a string, but then i've reread your description and now im not sure... what is the use case?
Title: Re: Programming help wanted.
Post by: Cas on September 24, 2021, 07:11:48 AM
Oh, this is the little program I made for the exclusive purpose of finding in the binary the letters "C", "O", "U", "N", to be able to configure the default car. I noticed in the assembly code that they were separated by the same amount, but couldn't be sure of what that amount was. This way, I was able to change the default car for the Ferrari Edition without having to recompile the program.