Bliss - Stunts Track Editor

Game development specific discussions.
Post Reply
xlucas
Posts: 334
Joined: May 09, 2014 21:19
Location: Argentina

Bliss - Stunts Track Editor

Post by xlucas »

I'm thinking it's time that I start making games in FreeBasic. I'll soon be posting some games, he, he. What I have now, that I would like to post, is not exactly a game. It's an editor, but a very special one. Do you know the 1990s game Stunts? If you do, you probably also know the Stunts online racing community (check http://zak.stunts.hu if you're interested). Well, I've been part of it for quite some time and I'm the one who made the track editor we use. I made it in FreeBasic, it's free software and it uses no third party software (i.e.: libraries). It can run in FreeDOS, GNU/Linux (both 32bit and 64bit) and Windows and it's completely portable, which is the way I like making software.

Hope you guys like it. Take a look:
http://www.dimioca.com/bliss/

And now I'll start working on some new game :)
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Bliss - Stunts Track Editor

Post by badidea »

I did the some thing ~10 years ago (in Powerbasic, I think). I'll try to find the code.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: Bliss - Stunts Track Editor

Post by sancho2 »

Looks interesting.

The source code editor you used places the LF and the end of a line but not the CR, so FBEdit puts everything on one line.
I am sure there are many cures for this but here is one (obviously, replace the filename paths as necessary):

Code: Select all

Const As String INFILE = "C:\Freebasic Stuff\StuntEditor\source\Bliss.bas"
Const As String OUTFILE = "C:\Freebasic Stuff\StuntEditor\source\yBliss.bas"

Dim As Integer fNum, n, oNum
Dim As Byte c
Dim As String  s   ' temp. String

fNum = FreeFile()
Open INFILE For Binary As #fNum
	oNum = FreeFile()
	Open OUTFILE For Binary As #oNum

		While Not Eof(fNum)       ' here: all the 'action' takes place
		    Line Input #fNum, s   ' stops reading, at chr(10) - LINUX
		    Print #oNum, s        ' writes, with chr(13, 10) - WINDOWS
		Wend
	Close #oNum
Close #fNum
Last edited by sancho2 on May 20, 2017 1:50, edited 1 time in total.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Bliss - Stunts Track Editor

Post by MrSwiss »

@sancho2,

below, a simplified version, of the while .. wend loop (no additional checks needed!).
Files are opened "for Input" and "for Output" (no binary needed).
And, of course, a lot faster (line by line, instead of: byte by byte):

Code: Select all

' f1 and f2 are the open file numbers
Dim As String  s   ' temp. String

While Not Eof(f1)       ' here: all the 'action' takes place
    Line Input #f1, s   ' stops reading, at chr(10) - LINUX
    Print #f2, s        ' writes, with chr(13, 10) - WINDOWS
Wend
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: Bliss - Stunts Track Editor

Post by sancho2 »

Thank you Mr Swiss.
I did not realize that Line Input could get its end of line from the line feed character only.
thesanman112
Posts: 538
Joined: Jul 15, 2005 4:13

Re: Bliss - Stunts Track Editor

Post by thesanman112 »

I didnt know you could use line input on a file opened in binary....so im assuming it inputs until end of line character??? Thats pretty neat!!
thesanman112
Posts: 538
Joined: Jul 15, 2005 4:13

Re: Bliss - Stunts Track Editor

Post by thesanman112 »

Im actually working on a couple things that read wav files in binary, and bitmaps in binary.
xlucas
Posts: 334
Joined: May 09, 2014 21:19
Location: Argentina

Re: Bliss - Stunts Track Editor

Post by xlucas »

Oh... well, I didn't realise I had published it in Linux format. Well, Geany can be configured to insert the CR/LF line end instead. I usually don't realise when a text file is one or the other format because I'm always on Linux, but this is not the first time somebody makes me notice and I change it. It happened to me with the doc file for that same program, as a matter of fact. Thanks, guys.
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Re: Bliss - Stunts Track Editor

Post by Lachie Dazdarian »

I adored Stunts back in the day. It's great to see there is still an active community around that game.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Bliss - Stunts Track Editor

Post by Tourist Trap »

xlucas wrote: Hope you guys like it. Take a look:
http://www.dimioca.com/bliss/

And now I'll start working on some new game :)
Very appealing ;) A nice classics anyway!
xlucas
Posts: 334
Joined: May 09, 2014 21:19
Location: Argentina

Re: Bliss - Stunts Track Editor

Post by xlucas »

Thanks, guys. Yes, it's very nice to be able to write a project for that game. If it weren't for the community inspiring it, I wouldn't have made the editor and I can say I've learnt much from developing it.
Post Reply