# \[ANN\] Formido - a shooting game

**URL:** <https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226>\
**Category:** SDL Development\
**Created:** [February 7, 2003, 6:07am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226 "2003-02-07T06:07:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mika\_Halttunen](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@Mika\_Halttunen](https://discourse.libsdl.org/u/Mika_Halttunen)\
**Post date:** [February 7, 2003, 6:07am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/1 "2003-02-07T06:07:00Z")

</div>

Greetings,  
I just got my first SDL game uploaded. It’s called Formido.

Formido is one of those games, where you are loaded with some guns and you go  
shooting different things. ‘Things’ in this case are big, ugly, - not green  
though - alien insects. The idea is to kill as many of those bastards as  
possible. Eventually they will overcome you, but struggle as long as you can.  
There are some power-ups to aid you in your honorable quest. Keep in mind,  
that those critters are rather tough and generally do nasty things when in  
close range of any player-characters. If you have ever played any Phobia  
games, you know what I’m talking about.

It’s released under the terms of the GNU GPL.

Grab it (and all of my other games) from  
[http://www.mhgames.cjb.net](http://www.mhgames.cjb.net)

Drop me some feedback, at least if you like it! =)

PS. The Linux version isn’t working yet - and I need some help from you  
Linux/SDL-gurus. Check the Formido’s page for details.

Thanks.–  
Mika Halttunen  
@Mika_Halttunen

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [February 7, 2003, 7:39am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/2 "2003-02-07T07:39:00Z")

</div>

[…]

> Grab it (and all of my other games) from  
> [http://www.mhgames.cjb.net](http://www.mhgames.cjb.net)

Hey, those screenshots sure look great! Goes for all graphics on the  
site and in the other games as well, for that matter. 🙂

> Drop me some feedback, at least if you like it! =)
> 
> PS. The Linux version isn’t working yet - and I need some help from  
> you Linux/SDL-gurus. Check the Formido’s page for details.

Well, I don’t have much time, but I’ll have a look at it…

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.  
| Free/Open Source Audio Engine for use in Games or Studio. |  
| RT and off-line synth. Scripting. Sample accurate timing. |  
`---------------------------\> [http://olofson.net/audiality](http://olofson.net/audiality) -’  
— [http://olofson.net](http://olofson.net) — [http://www.reologica.se](http://www.reologica.se) —On Friday 07 February 2003 15.04, Mika Halttunen wrote:

---

<div class="post-metadata">

**Author:** ![Joby\_Bednar](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@Joby\_Bednar](https://discourse.libsdl.org/u/Joby_Bednar)\
**Post date:** [February 7, 2003, 9:27am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/3 "2003-02-07T09:27:02Z")

</div>

Well, my Office Scan detected a trojan virus when I downloaded it. I wouldn’t advise others to check it out.

- Joby  
[http://jobybednar.com](http://jobybednar.com)  
Give someone a program - frustrate them for a day.  
Teach them how to program - frustrate them for a lifetime.\> ----- Original Message -----

> From: [lsoft@mbnet.fi](mailto:lsoft@mbnet.fi) (Mika Halttunen)  
> Reply-To: sdl at [libsdl.org](http://libsdl.org)  
> Date: Fri, 7 Feb 2003 16:04:16 +0200
> 
> > Greetings,  
> > I just got my first SDL game uploaded. It’s called Formido.
> > 
> > Formido is one of those games, where you are loaded with some guns and you go  
> > shooting different things. ‘Things’ in this case are big, ugly, - not green  
> > though - alien insects. The idea is to kill as many of those bastards as  
> > possible. Eventually they will overcome you, but struggle as long as you can.  
> > There are some power-ups to aid you in your honorable quest. Keep in mind,  
> > that those critters are rather tough and generally do nasty things when in  
> > close range of any player-characters. If you have ever played any Phobia  
> > games, you know what I’m talking about.
> > 
> > It’s released under the terms of the GNU GPL.
> > 
> > Grab it (and all of my other games) from  
> > [http://www.mhgames.cjb.net](http://www.mhgames.cjb.net)
> > 
> > Drop me some feedback, at least if you like it! =)
> > 
> > PS. The Linux version isn’t working yet - and I need some help from you  
> > Linux/SDL-gurus. Check the Formido’s page for details.
> > 
> > ## Thanks.
> > 
> > Mika Halttunen  
> > lsoft at [mbnet.fi](http://mbnet.fi)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![atrix2](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/a9a28c/32.png) [@atrix2](https://discourse.libsdl.org/u/atrix2)\
**Post date:** [February 7, 2003, 9:37am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/4 "2003-02-07T09:37:00Z")

</div>

could be a false positive\> ----- Original Message -----

> From: [thebigcheese@jobybednar.com](mailto:thebigcheese@jobybednar.com) (Joby Bednar)  
> To:   
> Sent: Friday, February 07, 2003 9:27 AM  
> Subject: Re: [SDL] [ANN] Formido - a shooting game
> 
> > Well, my Office Scan detected a trojan virus when I downloaded it. I  
> > wouldn’t advise others to check it out.
> > 
> > - Joby  
> > [http://jobybednar.com](http://jobybednar.com)  
> > Give someone a program - frustrate them for a day.  
> > Teach them how to program - frustrate them for a lifetime.
> > 
> > ---------- Original Message ----------------------------------  
> > From: Mika Halttunen   
> > Reply-To: sdl at [libsdl.org](http://libsdl.org)  
> > Date: Fri, 7 Feb 2003 16:04:16 +0200
> > 
> > > Greetings,  
> > > I just got my first SDL game uploaded. It’s called Formido.
> > > 
> > > Formido is one of those games, where you are loaded with some guns and  
> > > you go  
> > > shooting different things. ‘Things’ in this case are big, ugly, - not  
> > > green  
> > > though - alien insects. The idea is to kill as many of those bastards as  
> > > possible. Eventually they will overcome you, but struggle as long as you  
> > > can.  
> > > There are some power-ups to aid you in your honorable quest. Keep in  
> > > mind,  
> > > that those critters are rather tough and generally do nasty things when  
> > > in  
> > > close range of any player-characters. If you have ever played any Phobia  
> > > games, you know what I’m talking about.
> > > 
> > > It’s released under the terms of the GNU GPL.
> > > 
> > > Grab it (and all of my other games) from  
> > > [http://www.mhgames.cjb.net](http://www.mhgames.cjb.net)
> > > 
> > > Drop me some feedback, at least if you like it! =)
> > > 
> > > PS. The Linux version isn’t working yet - and I need some help from you  
> > > Linux/SDL-gurus. Check the Formido’s page for details.
> > > 
> > > ## Thanks.
> > > 
> > > Mika Halttunen  
> > > lsoft at [mbnet.fi](http://mbnet.fi)
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [libsdl.org](http://libsdl.org)  
> > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Joby\_Bednar](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@Joby\_Bednar](https://discourse.libsdl.org/u/Joby_Bednar)\
**Post date:** [February 7, 2003, 9:45am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/5 "2003-02-07T09:45:01Z")

</div>

Could be. Since I work for a computer game company… and my boss may not be too pleased with me if it is infected and I release it into our network… I’ll let you guys tell me what you think of it. 😉

- Joby  
[http://jobybednar.com](http://jobybednar.com)  
Give someone a program - frustrate them for a day.  
Teach them how to program - frustrate them for a lifetime.\> ----- Original Message -----

> From: [atrix2@cox.net](mailto:atrix2@cox.net) (atrix2)  
> Reply-To: sdl at [libsdl.org](http://libsdl.org)  
> Date: Fri, 7 Feb 2003 09:41:56 -0800
> 
> > could be a false positive
> > 
> > ----- Original Message -----  
> > From: “Joby Bednar” \<@Joby\_Bednar\>  
> > To:   
> > Sent: Friday, February 07, 2003 9:27 AM  
> > Subject: Re: [SDL] [ANN] Formido - a shooting game
> > 
> > > Well, my Office Scan detected a trojan virus when I downloaded it. I  
> > > wouldn’t advise others to check it out.
> > > 
> > > - Joby  
> > > [http://jobybednar.com](http://jobybednar.com)  
> > > Give someone a program - frustrate them for a day.  
> > > Teach them how to program - frustrate them for a lifetime.
> > > 
> > > ---------- Original Message ----------------------------------  
> > > From: Mika Halttunen   
> > > Reply-To: sdl at [libsdl.org](http://libsdl.org)  
> > > Date: Fri, 7 Feb 2003 16:04:16 +0200
> > > 
> > > > Greetings,  
> > > > I just got my first SDL game uploaded. It’s called Formido.
> > > > 
> > > > Formido is one of those games, where you are loaded with some guns and  
> > > > you go  
> > > > shooting different things. ‘Things’ in this case are big, ugly, - not  
> > > > green  
> > > > though - alien insects. The idea is to kill as many of those bastards as  
> > > > possible. Eventually they will overcome you, but struggle as long as you  
> > > > can.  
> > > > There are some power-ups to aid you in your honorable quest. Keep in  
> > > > mind,  
> > > > that those critters are rather tough and generally do nasty things when  
> > > > in  
> > > > close range of any player-characters. If you have ever played any Phobia  
> > > > games, you know what I’m talking about.
> > > > 
> > > > It’s released under the terms of the GNU GPL.
> > > > 
> > > > Grab it (and all of my other games) from  
> > > > [http://www.mhgames.cjb.net](http://www.mhgames.cjb.net)
> > > > 
> > > > Drop me some feedback, at least if you like it! =)
> > > > 
> > > > PS. The Linux version isn’t working yet - and I need some help from you  
> > > > Linux/SDL-gurus. Check the Formido’s page for details.
> > > > 
> > > > ## Thanks.
> > > > 
> > > > Mika Halttunen  
> > > > lsoft at [mbnet.fi](http://mbnet.fi)
> > > > 
> > > > * * *
> > > > 
> > > > SDL mailing list  
> > > > SDL at [libsdl.org](http://libsdl.org)  
> > > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [libsdl.org](http://libsdl.org)  
> > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [February 7, 2003, 9:47am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/6 "2003-02-07T09:47:01Z")

</div>

Is this a self-extracting exe, or a single file exe with integrated  
data? Either way, the scanner might be reacting on the fact that the  
exe contains code for opening itself as a data file. That’s a really  
rather common thing to do for virues, so detectors often assume that  
they’re looking at unknown virus code.

Anyway, I suppose the source is safe (I’m on Linux) - but maybe I  
should check the build scripts and the code, just in case? 😉

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.  
| Free/Open Source Audio Engine for use in Games or Studio. |  
| RT and off-line synth. Scripting. Sample accurate timing. |  
`---------------------------\> [http://olofson.net/audiality](http://olofson.net/audiality) -’  
— [http://olofson.net](http://olofson.net) — [http://www.reologica.se](http://www.reologica.se) —On Friday 07 February 2003 18.27, Joby Bednar wrote:

> Well, my Office Scan detected a trojan virus when I downloaded it.  
> I wouldn’t advise others to check it out.

---

<div class="post-metadata">

**Author:** ![Anatoly\_R](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@Anatoly\_R](https://discourse.libsdl.org/u/Anatoly_R)\
**Post date:** [February 7, 2003, 11:12am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/7 "2003-02-07T11:12:01Z")

</div>

Hello David,

Friday, February 7, 2003, 7:46:11 PM, you wrote:

DO\> On Friday 07 February 2003 18.27, Joby Bednar wrote:

> > Well, my Office Scan detected a trojan virus when I downloaded it.  
> > I wouldn’t advise others to check it out.

DO\> Is this a self-extracting exe, or a single file exe with integrated  
DO\> data? Either way, the scanner might be reacting on the fact that the  
DO\> exe contains code for opening itself as a data file. That’s a really  
DO\> rather common thing to do for virues, so detectors often assume that  
DO\> they’re looking at unknown virus code.

DO\> Anyway, I suppose the source is safe (I’m on Linux) - but maybe I  
DO\> should check the build scripts and the code, just in case? 😉

Just tested the GREAT simple game with awesome graphics on my box with  
LATEST todays update for Antiviral Toolkit Pro which is the best  
antivirus solution in the world. No viruses found, no suspections with  
code analyzer enabled. Everything is perfect.

Mika, keep the great work!

And I’ll ask again - is anybody interested in supporting

[http://sdl.lynx.lv](http://sdl.lynx.lv) ?–  
Lynx,  
[http://dotNet.lv](http://dotNet.lv) mailto:@Anatoly_R

---

<div class="post-metadata">

**Author:** ![Rob\_van\_Putten](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/aca169/32.png) [@Rob\_van\_Putten](https://discourse.libsdl.org/u/Rob_van_Putten)\
**Post date:** [February 7, 2003, 11:26am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/8 "2003-02-07T11:26:01Z")

</div>

While reading the posts on this newsgroup it occured  
to me that people are using it to ‘promote’ their  
games / libs etc… I don’t think this is the appropriate  
newsgroup to tell about your new application / game.

I mean, if I want to know about new games and other  
stuff I just check out [libsdl.org](http://libsdl.org) or follow the newsgroup  
of that particular project.

I hope people don’t mind me saying it but I am not  
interested to read about people’s new projects in  
this newsgroup. I would appreciate it if these kind  
of postings would be discouraged.

I am curious if I am the only one who thinks this  
way??

Regards,  
Rob

---

<div class="post-metadata">

**Author:** ![Michael\_Alger](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/b77776/32.png) [@Michael\_Alger](https://discourse.libsdl.org/u/Michael_Alger)\
**Post date:** [February 7, 2003, 11:47am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/9 "2003-02-07T11:47:01Z")

</div>

> PS. The Linux version isn’t working yet - and I need some help from  
> you Linux/SDL-gurus. Check the Formido’s page for details.

I’m hardly a guru, but I’ll add my 2c anyway.

There seem to be basically two warnings; lack of newlines on the end  
of files (trivially fixed, but safely ignored anyway), and warnings  
about implicit typecasts. As far as I can see, they can be ignored  
fairly safely, but explicit typecasting might be better. (?)

As for the crash in the options, that’s easily fixed. The problem is  
that you allocate a “buffer” of one character, and then use strcpy()  
to copy a string into it. Obviously, this overflows the buffer, and  
I don’t know why Windows is letting you get away with it.

Anyway, I rewrote the code (menu.cpp:148) to:

```
if(key != -1) {
	// Get the key name from SDL
	char *buf;

            buf = strdup(SDL_GetKeyName((SDLKey)key));

	// Convert it to upper case
	for(unsigned int c=0; c<strlen(buf); c++) {
		buf[c] = toupper(buf[c]);
	}

	return buf;
}

```

and it runs fine on my system. Nice little game btw, aside from the  
fact I’m not much good at it. I got up to 34 kills before dying as  
my best effort. I could be missing the segfaults out of sheer luck,  
though, so I’ll keep at it… 😉  
-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: not available  
Type: application/pgp-signature  
Size: 189 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030207/a98bb418/attachment.pgp](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030207/a98bb418/attachment.pgp)On Fri, Feb 07, 2003 at 04:04:16PM +0200, Mika Halttunen wrote:

---

<div class="post-metadata">

**Author:** ![Anatoly\_R](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@Anatoly\_R](https://discourse.libsdl.org/u/Anatoly_R)\
**Post date:** [February 7, 2003, 11:53am UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/10 "2003-02-07T11:53:01Z")

</div>

Hello delphiro,

Friday, February 7, 2003, 9:20:12 PM, you wrote:

d\> While reading the posts on this newsgroup it occured  
d\> to me that people are using it to ‘promote’ their  
d\> games / libs etc… I don’t think this is the appropriate  
d\> newsgroup to tell about your new application / game.

d\> I mean, if I want to know about new games and other  
d\> stuff I just check out [libsdl.org](http://libsdl.org) or follow the newsgroup  
d\> of that particular project.

d\> I hope people don’t mind me saying it but I am not  
d\> interested to read about people’s new projects in  
d\> this newsgroup. I would appreciate it if these kind  
d\> of postings would be discouraged.

d\> I am curious if I am the only one who thinks this  
d\> way??

What’s the other place where you can talk about your SDL projects?  
Official SDL site doesn’t report about updates of your masterpiece and  
doesn’t report every single release. That mailing list is probably the  
only place where you have a chance to show the app to the SDL world.–  
Lynx,  
[http://dotNet.lv](http://dotNet.lv) mailto:@Anatoly_R

---

<div class="post-metadata">

**Author:** ![Glenn\_Maynard](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/bcef8e/32.png) [@Glenn\_Maynard](https://discourse.libsdl.org/u/Glenn_Maynard)\
**Post date:** [February 7, 2003, 12:08pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/11 "2003-02-07T12:08:02Z")

</div>

> While reading the posts on this newsgroup it occured  
> to me that people are using it to ‘promote’ their  
> games / libs etc… I don’t think this is the appropriate  
> newsgroup to tell about your new application / game.

Unless there’s an nntp/mail gateway that I’m not aware of, this is a  
mailing list, not a newsgroup.

> I hope people don’t mind me saying it but I am not  
> interested to read about people’s new projects in  
> this newsgroup. I would appreciate it if these kind  
> of postings would be discouraged.

Easy solution: If you’re not interested in reading them, don’t read them.

(Likewise, I’m not interested in reading pointless complaining, so I’ll  
probably not read this thread any further. :)On Fri, Feb 07, 2003 at 08:20:12PM +0100, delphiro wrote:

–  
Glenn Maynard

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [February 7, 2003, 12:09pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/12 "2003-02-07T12:09:02Z")

</div>

Well, I think most of us are somewhat interested in what people are  
doing with SDL - especially if the code is available. However, there  
_is_ a list named SDL-announce. Problem is that you can’t comment on  
announcements, unless you reply in private, or the replies are  
redirected to another list, such as “SDL-projects” or whatever. If  
the server is smart enough, it would set the reply-to only if it sees  
that the annoucement poster is also subscribed to the SDL-projects  
list. (Not much point in sending comments there otherwise.)

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.  
| Free/Open Source Audio Engine for use in Games or Studio. |  
| RT and off-line synth. Scripting. Sample accurate timing. |  
`---------------------------\> [http://olofson.net/audiality](http://olofson.net/audiality) -’  
— [http://olofson.net](http://olofson.net) — [http://www.reologica.se](http://www.reologica.se) —On Friday 07 February 2003 20.20, delphiro wrote:

> While reading the posts on this newsgroup it occured  
> to me that people are using it to ‘promote’ their  
> games / libs etc… I don’t think this is the appropriate  
> newsgroup to tell about your new application / game.

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [February 7, 2003, 12:27pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/13 "2003-02-07T12:27:01Z")

</div>

[…]

> There seem to be basically two warnings; lack of newlines on the  
> end of files (trivially fixed, but safely ignored anyway), and  
> warnings about implicit typecasts. As far as I can see, they can  
> be ignored fairly safely, but explicit typecasting might be better.  
> (?)

Well, it’s safer, since when you see the warning, you will think  
“Oops, I didn’t mean to do an implicit cast there!”

I always use -Wall -Werror, so the code won’t even compile if there  
are warnings. If I’m _really_ paranoid, I use splint.

> As for the crash in the options, that’s easily fixed. The problem  
> is that you allocate a “buffer” of one character, and then use  
> strcpy() to copy a string into it. Obviously, this overflows the  
> buffer, and I don’t know why Windows is letting you get away with  
> it.

Maybe the suballocator has a block size granularity of some 32 bytes  
or so, to reduce fragmentation?

It’s really rather common that these kind of bugs show up only on some  
platforms. In my experience, working on multiple platforms helps you  
find sleeping bugs, which saves time if you frequently test on at  
least two platforms. The sooner you trip on a bug, the easier it is  
to find, generally.

Anyway, ElectricFence catches most of these things instantly, so they  
don’t cause crashes somewhere else about 5 mins later. (I love that  
kind of bugs… Not.) Recommended!

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.  
| Free/Open Source Audio Engine for use in Games or Studio. |  
| RT and off-line synth. Scripting. Sample accurate timing. |  
`---------------------------\> [http://olofson.net/audiality](http://olofson.net/audiality) -’  
— [http://olofson.net](http://olofson.net) — [http://www.reologica.se](http://www.reologica.se) —On Friday 07 February 2003 20.45, Michael Alger wrote:

---

<div class="post-metadata">

**Author:** ![Joby\_Bednar](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@Joby\_Bednar](https://discourse.libsdl.org/u/Joby_Bednar)\
**Post date:** [February 7, 2003, 12:33pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/14 "2003-02-07T12:33:05Z")

</div>

> Is this a self-extracting exe, or a single file exe with integrated  
> data? Either way, the scanner might be reacting on the fact that the  
> exe contains code for opening itself as a data file. That’s a really  
> rather common thing to do for virues, so detectors often assume that  
> they’re looking at unknown virus code.

Well, I tried it again and the download took far longer and without any warnings. I think the original download got interrupted and the fraction of the .exe that existed flagged some security settings. Sorry for the false positive.

Nice little game… though its a little difficult to control when you fire in one direction and run in another. I’d love to see more variety in maps, creatures, etc. A great little game to burn some free time on, though.

- Joby  
[http://jobybednar.com](http://jobybednar.com)  
Give someone a program - frustrate them for a day.  
Teach them how to program - frustrate them for a lifetime.

---

<div class="post-metadata">

**Author:** ![EvilTypeGuy](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@EvilTypeGuy](https://discourse.libsdl.org/u/EvilTypeGuy)\
**Post date:** [February 7, 2003, 3:27pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/15 "2003-02-07T15:27:01Z")

</div>

I seem to remember something about windows malloc clearing memory that  
was allocated whereas in linux it isn’t depending on whether or not  
debugging was active, can’t remember at the moment…

But, I’ve had this same problem on Linux before with stuff I work on…On Fri, 2003-02-07 at 13:45, Michael Alger wrote:

> As for the crash in the options, that’s easily fixed. The problem is  
> that you allocate a “buffer” of one character, and then use strcpy()  
> to copy a string into it. Obviously, this overflows the buffer, and  
> I don’t know why Windows is letting you get away with it.

---

<div class="post-metadata">

**Author:** ![Calvin\_Spealman](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@Calvin\_Spealman](https://discourse.libsdl.org/u/Calvin_Spealman)\
**Post date:** [February 7, 2003, 5:09pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/16 "2003-02-07T17:09:02Z")

</div>

Glenn Maynard wrote:

> Unless there’s an nntp/mail gateway that I’m not aware of, this is a  
> mailing list, not a newsgroup.

There is. [www.gmane.org](http://www.gmane.org)

---

<div class="post-metadata">

**Author:** ![Calvin\_Spealman](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@Calvin\_Spealman](https://discourse.libsdl.org/u/Calvin_Spealman)\
**Post date:** [February 7, 2003, 5:14pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/17 "2003-02-07T17:14:01Z")

</div>

delphiro wrote:

> I am curious if I am the only one who thinks this  
> way??

I agree. Everyone should post their announcements to dedicted forums  
like [gamedev.net](http://gamedev.net)’s announcement forum, or maybe some game developement  
newsgroup. not here.

---

<div class="post-metadata">

**Author:** ![Glenn\_Maynard](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/bcef8e/32.png) [@Glenn\_Maynard](https://discourse.libsdl.org/u/Glenn_Maynard)\
**Post date:** [February 7, 2003, 5:48pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/18 "2003-02-07T17:48:00Z")

</div>

Cool. (But it’s still not a newsgroup, just a gated list. 🙂

(Anyway.)On Fri, Feb 07, 2003 at 08:06:56PM -0500, Calvin Spealman wrote:

> > Unless there’s an nntp/mail gateway that I’m not aware of, this is a  
> > mailing list, not a newsgroup.
> 
> There is. [www.gmane.org](http://www.gmane.org)

–  
Glenn Maynard

---

<div class="post-metadata">

**Author:** ![Kylotan](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@Kylotan](https://discourse.libsdl.org/u/Kylotan)\
**Post date:** [February 7, 2003, 5:59pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/19 "2003-02-07T17:59:02Z")

</div>

> > PS. The Linux version isn’t working yet - and I need some help from  
> > you Linux/SDL-gurus. Check the Formido’s page for details.
> 
> As for the crash in the options, that’s easily fixed. The problem is  
> that you allocate a “buffer” of one character, and then use strcpy()  
> to copy a string into it. Obviously, this overflows the buffer, and  
> I don’t know why Windows is letting you get away with it.
> 
> Anyway, I rewrote the code (menu.cpp:148) to:
> 
> if(key != -1) {  
> // Get the key name from SDL  
> char \*buf;
> 
> ```
> buf = strdup(SDL_GetKeyName((SDLKey)key));
> 
> ```
> 
> // Convert it to upper case  
> for(unsigned int c=0; c\<strlen(buf); c++) {  
> buf[c] = toupper(buf[c]);  
> }
> 
> return buf;  
> }

Sadly, I don’t think this is much better than the original. The original  
code was indeed writing into a 1-byte ‘buffer’, which it probably isn’t  
allowed to write to anyway. (AFAIK, stating “” in C gets you a constant  
string literal, and thus this shouldn’t be written into. It might not  
even be writable memory at the time of execution.) But in avoiding this  
problem., this new code contains a memory leak, in that it allocates  
memory with that strdup call each time and never frees it. At a couple  
of bytes a time, this is unlikely to be a big problem, but it’s still  
Wrong! 🙂

Assuming this application is single-threaded, the best solution is  
probably to allocate a static char buffer inside the function, copy the  
text into that, and return its address from the function. Make the  
buffer a nice safe 128 characters long or so, and use strncpy (or is  
that \_strncpy?) to ensure that you never overflow that buffer even so.

If you’re multithreading, you don’t really want to use some sort of  
static buffer; instead, add relevant ‘free’ calls after each call to  
key\_name() and make sure that it’s always returning a freeable pointer  
(ie. strdup the constants too).

Or lastly, you could just set up your own array of keynames, populating  
them at the start of the program by calling SDL\_GetKeyName for  
everything up to SDLK\_LAST, changing them to upper case yourself, and  
returning pointers to them instead.From: [sdl@lists.rapacity.dyndns.org](mailto:sdl@lists.rapacity.dyndns.org) (Michael Alger)  
Sent: Friday, February 07, 2003 7:45 PM  
Subject: Re: [SDL] [ANN] Formido - a shooting game

> On Fri, Feb 07, 2003 at 04:04:16PM +0200, Mika Halttunen wrote:

–  
Kylotan  
[http://pages.eidosnet.co.uk/kylotan](http://pages.eidosnet.co.uk/kylotan)

---

<div class="post-metadata">

**Author:** ![Michael\_Alger](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/b77776/32.png) [@Michael\_Alger](https://discourse.libsdl.org/u/Michael_Alger)\
**Post date:** [February 7, 2003, 7:33pm UTC](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226/20 "2003-02-07T19:33:00Z")

</div>

> > > PS. The Linux version isn’t working yet - and I need some help from  
> > > you Linux/SDL-gurus. Check the Formido’s page for details.

> > As for the crash in the options, that’s easily fixed. The problem is  
> > that you allocate a “buffer” of one character, and then use strcpy()  
> > to copy a string into it. Obviously, this overflows the buffer, and  
> > I don’t know why Windows is letting you get away with it.

> > Anyway, I rewrote the code (menu.cpp:148) to:

> > [obvious memory leak]

> Sadly, I don’t think this is much better than the original.

Yeah, that did occur to me after I’d gone to bed, but at the time I  
was more interested in actually playing it, since it already looked  
pretty impressive just in the main menu. 😉

> (AFAIK, stating “” in C gets you a constant string literal, and thus  
> this shouldn’t be written into. It might not even be writable memory  
> at the time of execution.)

I was thinking that as well – perhaps MSVC is putting the string in  
the data area and thus doesn’t mind you trampling all over (and past  
the end of) it, while g++ is leaving it in the program text area?

For any interested parties, a statically allocated 128 byte character  
array seems to be more than sufficient, and doesn’t leak. 🙂

Incidentally, does sdldoc.csn.ul.ie not exist anymore? I can’t seem  
to resolve the hostname…  
-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: not available  
Type: application/pgp-signature  
Size: 189 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030207/5f0a3fc6/attachment.pgp](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030207/5f0a3fc6/attachment.pgp)On Sat, Feb 08, 2003 at 01:58:11AM -0000, Kylotan wrote:

> From: Michael Alger \<@Michael\_Alger\>  
> Sent: Friday, February 07, 2003 7:45 PM
> 
> > On Fri, Feb 07, 2003 at 04:04:16PM +0200, Mika Halttunen wrote:

[Next page](https://discourse.libsdl.org/t/ann-formido-a-shooting-game/8226.md?page=2)
