Show us yer programming projects!

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
Narrenschiff
Posts: 2
Joined: Sun Aug 13, 2006 4:23 pm 0
Location: North England
Contact:

Post by Narrenschiff »

chris_b wrote:
Narrenschiff wrote:FM sound toy for talking to giant ants in 50's B-movies
Wtf? any chance of some audio samples for non- :macwanker: s?
Sure! I stuck a few samples online at http://www.xolotl.plus.com/ant/
User avatar
Muttley
Sheepie Whore
Sheepie Whore
Posts: 13169
Joined: Thu Apr 25, 2002 12:30 pm 0
XBL Gamertag: Mu77ley
Location: In a maze of twisty passages, all alike.
Contact:

Post by Muttley »

I've started making a new tool to generate and update the Llamascores high-score tables for me using BlitzMax. My current one is very basic and written in BlitzPlus, so this time I'm working on something a bit more powerful/flexible. I'm also using XML to store the data (using a libxml module for BlitzMax), which I started looking at this morning purely because I'm too lazy to write an INI file or CSV parser. :lol:

Fuck knows if I'm doing it right though, as all the docs I've found on XML seem to be written in gibberish. :)

Code: Select all

<?xml version="1.0"?>
<Game name="Space Giraffe" platform="Xbox 360" version="Full Release">
  <Table title="Hi-Scores" scoretype="Int" order="HiLo">
    <Entry player="Player0" score="419"/>
    <Entry player="Player1" score="213"/>
    <Entry player="Player2" score="695"/>
    <Entry player="Player3" score="150"/>
    <Entry player="Player4" score="571"/>
    <Entry player="Player5" score="171"/>
    <Entry player="Player6" score="762"/>
    <Entry player="Player7" score="367"/>
    <Entry player="Player8" score="456"/>
    <Entry player="Player9" score="587"/>
  </Table>
  <Table title="Lo-Scores" scoretype="Int" order="LoHi">
    <Entry player="Player0" score="988"/>
    <Entry player="Player1" score="637"/>
    <Entry player="Player2" score="600"/>
    <Entry player="Player3" score="250"/>
    <Entry player="Player4" score="583"/>
    <Entry player="Player5" score="581"/>
    <Entry player="Player6" score="634"/>
    <Entry player="Player7" score="811"/>
    <Entry player="Player8" score="596"/>
    <Entry player="Player9" score="473"/>
  </Table>
</Game>
Muttley's Blog: Rarely updated, occasionally interesting… maybe
RetroRemakes Framework: Open Source BlitzMax Game Framework
MuttMod: My Open Source BlitzMax Modules
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Post by piku »

Muttley wrote:<Entry player="Player0" score="419"/>
Alternately, why not just

<player name="Piku">90000</player>
or even
<player name="piku" score="9000" />

Usually the tags should make sense, rather than being generic concepts. Does the hiscore table contain anything other than players?

XML can get quite mad if you do it "correctly"...

<player name="piku">
<score>3000</score>
</player>
return (0);
User avatar
Muttley
Sheepie Whore
Sheepie Whore
Posts: 13169
Joined: Thu Apr 25, 2002 12:30 pm 0
XBL Gamertag: Mu77ley
Location: In a maze of twisty passages, all alike.
Contact:

Post by Muttley »

piku wrote:
Muttley wrote:<Entry player="Player0" score="419"/>
Alternately, why not just

<player name="Piku">90000</player>
or even
<player name="piku" score="9000" />

Usually the tags should make sense, rather than being generic concepts. Does the hiscore table contain anything other than players?
Each table entry will also have a screenshot and recording filename. The type of score entry may also change dependent on the table. For example, a racing game could have a mm:ss.ms format.
piku wrote:XML can get quite mad if you do it "correctly"...

<player name="piku">
<score>3000</score>
</player>
Don't care about it being correct, I just want it to work. ;)

Muttley
Muttley's Blog: Rarely updated, occasionally interesting… maybe
RetroRemakes Framework: Open Source BlitzMax Game Framework
MuttMod: My Open Source BlitzMax Modules
User avatar
ElfQrin
Baaaaaa!
Baaaaaa!
Posts: 4384
Joined: Mon Jul 28, 2003 12:55 pm 0
Location: Italy
Contact:

Post by ElfQrin »

Muttley wrote: Alternately, why not just

<player name="Piku">90000</player>
or even
<player name="piku" score="9000" />
I'd say

<score player="piku">90000</score>

otherwise

<entry player="piku" score="9000" />

looks more correct to me: I don't particularly like the generic "entry" tag too, but it's actually an entry of the "Hi-Scores" table.
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Post by piku »

Make XML in the same way you'd make a database or OO designed program. I.e chop the data up into logical chunks and sub-chunks. Something like this would be nicely expandable:

Code: Select all

<table name="Geometry Wars">
  <rom>www.warez.com/geom.rom</rom>
  <forumlink>http://www.yakyak.org/view.php?id=213443</forumlink>
  <entry>
    <player>piku</player>
    <score>3000</score>
    <screenshot>http://www.blah.com/shot1.png</screenshot>
    <demo>...</demo>
  </entry>
</table>
Which isn't that complex, but allows you to store lots of useful info about each entry. Also, parsing <foo>DATA</foo> tags is easier than parsing the name="something" part. XML parsers confuse me sometimes.
return (0);
User avatar
ElfQrin
Baaaaaa!
Baaaaaa!
Posts: 4384
Joined: Mon Jul 28, 2003 12:55 pm 0
Location: Italy
Contact:

Post by ElfQrin »

piku wrote:Make XML in the same way you'd make a database or OO designed program. I.e chop the data up into logical chunks and sub-chunks. Something like this would be nicely expandable:
mmm... yes, I like this solution better than the other ones.
User avatar
tufty
Sheepie Whore
Sheepie Whore
Posts: 12525
Joined: Fri Jan 07, 2005 4:52 pm 0
Location: French Alps

Post by tufty »

ElfQrin wrote:
piku wrote:Make XML in the same way you'd make a database or OO designed program. I.e chop the data up into logical chunks and sub-chunks. Something like this would be nicely expandable:
mmm... yes, I like this solution better than the other ones.
I'd say that, assuming entries are one-per-player, the containing element should probably be "player"

Thus you'd have something like:

Code: Select all

...
<player>
  <name>piku</name>
  ...
</player>
If it's getting any more complex than that, for example if you are trying to link a "table" of entries per game to a "table" of player details, then don't do it in XML, do it in a bloody RDBMS like it's supposed to be done :)

Code: Select all

-- Player table
create table player(id serial not null primary key, name varchar not null unique);

-- Game table
create table game(id serial not null primary key, name varchar not null, rom_url varchar not null);

-- Season table
create table season(id int not null unique primary key);

-- Competition table
create table competition(id serial not null primary key, season_id int not null references season(id) on delete cascade, game_id int not null references game(id) on delete restrict, start_date timestamp, end_date timestamp);
create index competition_season_id_idx on competition(season_id);
create index competition_game_id_idx on competition(game_id);

create table score(id serial not null primary key, player_id int not null references player(id) on delete cascade, competition_id int not null references competition(id) on delete cascade, score numeric not null, screenshot bytea, replay bytea);
create index score_player_id_idx on score(player_id);
create index score_competition_id_idx on score(competition_id);
create unique index score_player_competition_unq on score(player_id, competition_id);
Simon
"massive retard™", "full of shit™", "tiny bitch™", "retarted™", "a bit of a one trick pony™", "petty™", "simple minded idealistic twat™", "miserable humourless fucker™"
User avatar
Muttley
Sheepie Whore
Sheepie Whore
Posts: 13169
Joined: Thu Apr 25, 2002 12:30 pm 0
XBL Gamertag: Mu77ley
Location: In a maze of twisty passages, all alike.
Contact:

Post by Muttley »

Cheers for that.
tufty wrote:If it's getting any more complex than that, for example if you are trying to link a "table" of entries per game to a "table" of player details, then don't do it in XML, do it in a bloody RDBMS like it's supposed to be done :)
Nah, this is just a quick fix to get some web pages generated easily. Ideally I'd like some kind of intereactive, database driven website where people can input their scores and stuff is all worked out automagically on the fly. In fact I started designing the database in the past. Unfortunately lack of time and skills (I needed to learn something like PHP, and I just don't have the time) means that I've got knowhere with that for a while.

Muttley
Muttley's Blog: Rarely updated, occasionally interesting… maybe
RetroRemakes Framework: Open Source BlitzMax Game Framework
MuttMod: My Open Source BlitzMax Modules
User avatar
ElfQrin
Baaaaaa!
Baaaaaa!
Posts: 4384
Joined: Mon Jul 28, 2003 12:55 pm 0
Location: Italy
Contact:

Post by ElfQrin »

tufty wrote:
ElfQrin wrote:
piku wrote:Make XML in the same way you'd make a database or OO designed program. I.e chop the data up into logical chunks and sub-chunks. Something like this would be nicely expandable:
mmm... yes, I like this solution better than the other ones.
I'd say that, assuming entries are one-per-player, the containing element should probably be "player"
I'm not playing the llamasoft contest, so I assumed there could be more than one entry for the same player in the high score table. In this case <player>...</player> as a container could indeed be better.
User avatar
hukka
Baaa!
Baaa!
Posts: 213
Joined: Sun Nov 21, 2004 1:42 am 0
Location: Finland
Contact:

Post by hukka »

I did a bitmap font (FNT/FON) editor for Windows:

Image

(Webpage)
Signature
User avatar
ElfQrin
Baaaaaa!
Baaaaaa!
Posts: 4384
Joined: Mon Jul 28, 2003 12:55 pm 0
Location: Italy
Contact:

Post by ElfQrin »

hukka wrote:I did a bitmap font (FNT/FON) editor for Windows:

Image

(Webpage)
Nice... I'm not using such kind of stuff since the Commodore 64 era :-)
User avatar
Barney
Baaaaaa!
Baaaaaa!
Posts: 2131
Joined: Tue Aug 23, 2005 7:59 pm 0
Location: UK, Broughton, Brigg

Post by Barney »

ElfQrin wrote:
hukka wrote:I did a bitmap font (FNT/FON) editor for Windows:
Nice... I'm not using such kind of stuff since the Commodore 64 era :-)
I'm writing one for the Speccy :-)

Image

And it also does sprites:

Image
Treb
Posts: 6
Joined: Mon Mar 20, 2006 9:01 pm 0
Location: London

Post by Treb »

This is my current little project. Basically its a updated version of a game I coded on the amstrad cpc about 18 years ago. Was always my favorite game that I'd written (if technically one of the worst) so I vowed one day to do a sequel.

Image

Still little more than a 1 level demo, but I'm having fun playing with it.
If you fancy a little play it's here, I'd be interested to know what people think.
"www.eakiah.pwp.blueyonder.co.uk/ball bearing.zip"

Anyway that's my 1st post over and done with. All in all I think it went pretty well :P

Regards rob
Live slow, Die Young
User avatar
the2bears
Baaaaaa!
Baaaaaa!
Posts: 3686
Joined: Wed Oct 27, 2004 9:30 pm 0
Location: The City by the Bay
Contact:

Post by the2bears »

Looks good from the screenshot Treb, welcome to the forum :) I'll try this out later, when I'm not at work (who am I kidding, I'll try it here ;) )

Bill
the2bears - the indie shmup blog
Post Reply