Procedural Programming Competition Final Rules

Blitz3D Forums/Blitz3D Programming/Procedural Programming Competition Final Rules

Craig H. Nisbet(Posted 2004) [#1]
Procedural Programming Competition

Show your programming skill by writing a game that has no external content!!!

- 2D or 3D welcome.
- No resources packed into the EXE either in any form (as DATA, or in any appended method)
- All resources (sounds, images, meshes, etc) must be generated by code. (eg. AddTriangle, CreateImage, etc) Although level defination data (like array data is valid)
- All code must be your own, this is a competition of your programming abilities, not those of someone who posted to code archives or whatever.
- No calls to external libraries. Included .bb files of your own are welcome, but no DLLs, .decls, etc.
- Files may only be written out in instances where it is impossible to utilize a function of Blitz without writing a file. All the file in the data must be generate by code. Examples of uses for this:
... Sounds.
... Save game files.
... OpenMovie (if you use animated GIFs.. I don't see anyone generating an AVI in runtime :))
... LoadMD2 (remember though, the contents of the model must be generate by code, not DATA statements, so again I don't see people using this, but its here to illustrate the point.)
- No references to any files NOT created by your program. Ie, you can't decide to use DING.WAV as a sound effect simply because it's there.

Submition!

Entries will be accepted between Monday October 23rd and November 8th. Submit entries to this forum thread by a link or by including the code text in you post.

You can use include files while creating your entry, but the file submitted entry must be 1 bb file. So all the includes will have to be copied to this bb file before submitting.

Awards
1st Place
2nd Place
3rd Place

Awards...well, you'll have a great game to show your buddies...ok, basically there is no prize, but what the heck, it will be a lot of fun!!!

The week after the 8th, we'll let people, other then the people that entered, vote on their favorites.


BlackD(Posted 2004) [#2]
Yay! Time to start coding. :) BTW, are multiple entries allowed?


Craig H. Nisbet(Posted 2004) [#3]
sure, why not.


morduun(Posted 2004) [#4]
For clarification: accessing fonts aside from the default is also disallowed? Otherwise symbols and such could be stupidly easy to drag up via a LoadFont call.


BlackD(Posted 2004) [#5]
"No references to any files NOT created by your program. Ie, you can't decide to use DING.WAV as a sound effect simply because it's there."
Yes, no fonts. A font is an external file. :)


morduun(Posted 2004) [#6]
Technically you're calling an outside file by default even without LoadFont when you use the Text commands (MS Sans Serif.ttf if I remember right). Just wanted to be sure it was safe to assume we could use the default font but nothing else.


aab(Posted 2004) [#7]
I dont think the default font should be allowed:
you could of course create an internally stored font engine of your own...


_PJ_(Posted 2004) [#8]
In the instance of meshes etc created by code, yet Loaded by the actual comp entry, should the generating code be submitted also?


Damien Sturdy(Posted 2004) [#9]
@aab.... course the default font should be alowed- all systems have a form of "print" command >.<

@malice...
the entry cannot have any files along with the main .bb file, so your entry must generate the mesh itself.


_PJ_(Posted 2004) [#10]

- Files may only be written out in instances where it is impossible to utilize a function of Blitz without writing a file. All the file in the data must be generate by code. Examples of uses for this:
... Sounds.
... Save game files.
... OpenMovie (if you use animated GIFs.. I don't see anyone generating an AVI in runtime :))
... LoadMD2 (remember though, the contents of the model must be generate by code, not DATA statements, so again I don't see people using this, but its here to illustrate the point.)


?


morduun(Posted 2004) [#11]
He means the MD2 must be generated by the program itself at runtime prior to running the game.

The file format can be found here if you feel up to it:

http://linux.ucla.edu/~phaethon/q3a/formats/md2-schoenblum.html


Craig H. Nisbet(Posted 2004) [#12]
My games comming along quite nicely, how about yours? :P


morduun(Posted 2004) [#13]
Very well thankee. :P


Stevie G(Posted 2004) [#14]
No using the default font?! Is it not better spending more time on the game itself? This seems a bit extreme to me - fair enough sounds and meshes etc.. but .. you're kidding right?

Anywho I started making Stunt Car racer but wouldn't have had the time to do the physics .. a WIP screenie.




morduun(Posted 2004) [#15]
Oooooo lookin nice Stevie G. You're dangerous at this stuff so I fully expect that'll be aces to play!


BlackD(Posted 2004) [#16]
Well, I don't think Craig meant we're not allowed to use the default font. :) If we weren't allowed to, them by the same logic we couldn't use any graphics, as Blitz calls DirectX dlls. ;) In fact, no text, no graphics, we can just make diferent sized black-screens. ;) But seriously, I'm using default font and some conversion routines to make it into something nicer. :)

Anyway, a couple of pretty boring WIP shots..



Lots of pretty pre-rendering (yes, my game has "loading" screens hehe) going on. :)

+BlackD


Damien Sturdy(Posted 2004) [#17]
druck! (i say "druck" because my last post with a swear in it got removed)..yousa kicked my ass already!


BlackD(Posted 2004) [#18]
lol.. yeah - but those of us going all-out with our games may not finish in time. Besides its about having fun, so don't worry. :)


Craig H. Nisbet(Posted 2004) [#19]
Alright alright, I'll allow the default font, BUT THAT'S IT!!!!!


BlackD(Posted 2004) [#20]
wow stevieg - that's pretty darn impressive since the comp started yesterday. :) wish i could do that in one day.


Damien Sturdy(Posted 2004) [#21]
im only in it to have fun, no point otherwise :D

Course, i could include quad v1.0, which was all generated meshes.

@StevieG: that looks MAD! how did you generate the meshes!?


Stevie G(Posted 2004) [#22]
It took 32,000 lines of data to create that track - do you think I'll get done for cheating!?

Only kidding!!! Believe it or not it takes very little code and data to do this - that whole track is initially 24 * (x,y,z data coords ) - all the other points are calculated using bezier interpolation between these points. The kerbs, grass verge etc.. are just extrusions perpendicular to the middle of the road etc...


BlackD(Posted 2004) [#23]
hax ;)


Stevie G(Posted 2004) [#24]
Hax?


Craig H. Nisbet(Posted 2004) [#25]
Stevie. Level defination data is valid for the contest. I procedurely created level would probably be pretty boring.


Damien Sturdy(Posted 2004) [#26]
@steve:
Thats pretty neat- any chance of seeing how youve done it? obviously if you dont want to let it out, thats okay, but that code...well, itl help me out quite a bit in a few areas!!!

I can see youve used a plane, so that simplifies things out- i myself have made a track creation routine in a certain mode of quad2 but ive had to select certain "random seeds" so the tracks dont cross over- which would just rock if i could do it...

Heres what i did... unfortunately in this screenie ive moved far away from anything alowed in this contest but it did all START "procedural" :/



Stevie G(Posted 2004) [#27]
I can't see your picture mate.

It's not optimised in any shape or form and a bit sloppy but for what it's worth ...




Damien Sturdy(Posted 2004) [#28]
cheers dude

Odd about that pic- if you paste the link into FireFox it works.. but there, it doesnt. godknows.

Il check it out tomorow. While my server is down i have no real power over the files! :(

[edit]

Mate, that is AMAZING.

would you mind me taking that code to learn from? its not too dissimilar to my routine but yours seems more efficient than mine and caps holes in meshes (the side bits and tunnels)

IMO, you should turn this into an entry still. You dont need physics to make it fun!!! shove some AI in there, a menu screen, n (maybe) a quick powerboost collectable... and you have a blitz hit!

Nice work dude!


..Meanwhile, my entry is going slow as im now working again :(


Craig H. Nisbet(Posted 2004) [#29]
I've always wondered this. How do you guy post your code so it's green like that? I've also seen were you have it in a little window with scroll bar on the side.


N(Posted 2004) [#30]
<code></code>

and

<codebox></codebox>

And, of course, you replace the angular brackets with square brackets ([]).


daaan(Posted 2004) [#31]
The name of my incredibly week entry is SQUARE APPLES! In the game you are in control of a laser ball cannon and you have to launch laser balls at the decending SQUARE APPLES! its pretty easy and the game lasts like 60 seconds but its the first time ive ever made a game only using blitz functions to create all the artwork. Enjoy.

SQUARE APPLES!.zip
http://www.omzignilmerg.com/SQUARE%20APPLES!.zip


Damien Sturdy(Posted 2004) [#32]
i wouldnt say thats weak, thats quite fun for a small amount of time :D


RiverRatt(Posted 2004) [#33]
Here is a screenshot of my entry that I don't think will be done in time. But what do ya think? It's a cross between space invaders,astroids,and dare I say it... Diablo.




Damien Sturdy(Posted 2004) [#34]
Nice lookin work matie! may i suggest creating a new text routine though, create a set of images for each char and use the normal text and colour commands to draw to the images... can look quite a bit nicer than the blitz normal font...


Damien Sturdy(Posted 2004) [#35]
i got a quick question.

Weve said DATA is allowed for levels providing they dont come from a level editor... this is okay for sounds too right?

i mean, ive written a sound system that runs using channels and such, like this:
sound channel,volume,pitch,length"


and ived stored my music like this:
Data 1,1,40,4
Data 2,1,52,4
Data 1,0,40,1
Data 2,0,52,1
Data 1,1,40,4
Data 2,1,52,4
Data 1,0,40,1
Data 2,0,52,1



is this okay? id imagine so as its not realy a stored resource.. but i dont want to get disqualified or anything :D


BlackD(Posted 2004) [#36]
yeah I'm pretty sure thats allowed. The rule against storing sounds as data is referring to storing sound data as data. Ie, you can't convert the DataChunk section of a WAV file to DATA statements, then simply write it back out along with a HeaderChunk and FormatChunk to create a perfectly original copy of the WAV file. :)

Creating the wave data by a mathematical statement ISN'T storing sound data. :) I did it the same way you did, writing out a sin wave. My code:


The sound has a click at the end that I never got around to ironing out. However sadly though, I am now withdrawing from this competition. I've been trying to work on my other main project (which I'm also under some time constraint to produce, though much longer :)) at the same time and although my entry is coming along nicely, I won't have time to finish it. :(

@StevieG: asking nicely.. :) Could you please change your CODE tags to CODEBOX cause thats making a huge amount of scrollage in this thread. :)

+BlackD


Damien Sturdy(Posted 2004) [#37]
Sorry to hear you withdrawing, BlackD, i may have to myself also.. but im trying.

With WAV, you need to end and start the .wav at 32762.5 otherwise you get the click.. not sure if youve done that!

whatever happens though, i will release the sound engine i wrote for this compo. My games got 1456 lines in it now!


BlackD(Posted 2004) [#38]
hehe.. that means, so far, Square Apples is winning! :D


Damien Sturdy(Posted 2004) [#39]
lol! its a nice lil game IMO. of course, il still work on my entry even if i miss the deadline, and il still let it out to y'all!!!


Stevie G(Posted 2004) [#40]
Codebox added - sorry :)

@Blackd - Blitz can't read the sound you created and the .wav doesn't play in windows media player? Not sure what's wrong there.

I too don't really have time to finish my entry on time - in the middle of making an Oids / Lundar lander level editor atm.


Regular K(Posted 2004) [#41]
One of the rules is: - All code must be your own, this is a competition of your programming abilities, not those of someone who posted to code archives or whatever.

Why do I see people posting their code, showing how they did something? Thats just asking people to use it in their entry.


Stevie G(Posted 2004) [#42]
Chill MrSAK it's only a piss about ... the winner gets HE HAW so what difference does it make?


Damien Sturdy(Posted 2004) [#43]
He was having a bad time.. hehe..
this is for fun.. enjoy it!


Craig H. Nisbet(Posted 2004) [#44]
Yeah, this is all in good fun. I don't know about you guys, but I'm having a total blast coding my game. Hope I can get it done in time too.

Love that wave code by the way, I don't know how to code sound, so I either cheat or have no sound.

Surprizingly, My friends at work here really like the game I came up with so far. I thought it was just kind of a hack. It's a mix between the original wolfenstein, a pinball machine, and tron. One guy actually played all the way through all the levels I made! Who knows, might be worth explanding into a full blow shareware title.

Wish I could show a pic, but I don't have webspace to do that. Anyone know an easy way to get your pics on the web?


Damien Sturdy(Posted 2004) [#45]
i would normally do that for you- but since BlueYonder seem to think i broke.. yeah, ive said it so many times :(

Yup, tis fun! Mine is bomberman+pacman+boulderdash... ^.^


RiverRatt(Posted 2004) [#46]
>>Wish I could show a pic, but I don't have webspace to do that. Anyone know an easy way to get your pics on the web?<<

I just use my home page made with one two three click. Thats a thing you get with Aol.


BlackD(Posted 2004) [#47]
@Craig Nisbet - yeah, just create a Geocities account and host the images there. Sure you only got like 100 meg transfer limit per day, but you're never going to use that up with a image shown in a thread. :) Mine are still up ^^


Damien Sturdy(Posted 2004) [#48]
its okay that i post a demo of my entry isnt it?


Demo

Screenie


Damien Sturdy(Posted 2004) [#49]
Hey, i had this as an edit before, but to bump this subject aswell:

if i post a link like this:
Http://danjeruz.servegame.com/Pics/compgame .JPG
then it wont show in a thread:

however, copying the link to a browser window works...!

i have to do this instead. Whats up with that?


Craig H. Nisbet(Posted 2004) [#50]
Wow! That sound system is amazing!


Damien Sturdy(Posted 2004) [#51]
I designed the sound system as an include, and it would work for a blugin in most programs.. just need to change some variable names and itl be ready. ive put about half the effort of this project into the sound system! hehe.

Il release source for everything at the end, as rules say. and im sure Blitzers will find many uses for the sound system, mainly in the 8-bit-compos!!!

Cheers again!

[edit]

I never realised i had given out the source. hehe. oh well, youl get it anyway so why not now :P


Craig H. Nisbet(Posted 2004) [#52]
Yeah, this a great open source contest. They should make a special section in the code archives for it, seeing there's no external content.

I'm think about seeing if I can find some sponsers for another compition like this one. This has been a lot of fun! Maybe next time we can have some actual prizes!

Here's a code donation from my project. Had to make some extended primitives.

Function CreateWedge(ParentEntity=0)
	wedge=CreateMesh()
	surf=CreateSurface(wedge)
	;Sides
	v1=AddVertex(surf,-1,-1,1,0,1)
	v2=AddVertex(surf,-1,1,-1,1,0)
	v3=AddVertex(surf,-1,-1,-1,1,1)
	AddTriangle(surf,v1,v2,v3)
	v4=AddVertex(surf,1,-1,1,1,1)
	v5=AddVertex(surf,1,1,-1,0,5)
	v6=AddVertex(surf,1,-1,-1,0,1)
	AddTriangle(surf,v6,v5,v4)

	;back
	v1=AddVertex(surf,-1,1,-1,0,0)
	v2=AddVertex(surf,1,1,-1,1,0)
	v3=AddVertex(surf,1,-1,-1,1,1)
	v4=AddVertex(surf,-1,-1,-1,0,1)
	AddTriangle(surf,v1,v2,v3)
	AddTriangle(surf,v1,v3,v4)

	;Wedge
	v1=AddVertex(surf,-1,-1,1,1,1)
	v2=AddVertex(surf,1,-1,1,0,1)
	v3=AddVertex(surf,1,1,-1,0,0)
	v4=AddVertex(surf,-1,1,-1,1,0)
	AddTriangle(surf,v1,v2,v3)
	AddTriangle(surf,v1,v3,v4)

	;Bottom
	v1=AddVertex(surf,-1,-1,1,0,1)
	v2=AddVertex(surf,1,-1,1,1,1)
	v3=AddVertex(surf,1,-1,-1,1,0)
	v4=AddVertex(surf,-1,-1,-1,0,0)
	AddTriangle(surf,v3,v2,v1)
	AddTriangle(surf,v3,v1,v4)

	UpdateNormals wedge
	EntityFX wedge,4
	If ParentEntity > 0 Then EntityParent(wedge,ParentEntity)
	Return wedge
End Function

Function CreateSquare(Axis=3,ParentEntity = 0)
;Axis X =1 , Y=2, Z=3
	Square=CreateMesh()
	surf=CreateSurface(Square)
	;Bottom
	v1=AddVertex(surf,-1,0,-1,0,0)
	v2=AddVertex(surf,1,0,-1,1,0)
	v3=AddVertex(surf,1,0,1,1,1)
	v4=AddVertex(surf,-1,0,1,0,1)
	If Axis = 1 Then
		RotateMesh Square,0,0,90
	Else If Axis = 3 Then
		RotateMesh Square,-90,0,0
	End If
	AddTriangle(surf,v3,v2,v1)
	AddTriangle(surf,v3,v1,v4)
	UpdateNormals Square
	EntityFX Square,4
	If ParentEntity > 0 Then EntityParent(Square,ParentEntity)
	Return Square
End Function

Dim Prim_Circle(0)

Function CreateCircle(Segments = 12,Axis=3,ParentEntity = 0)
;Axis X =1 , Y=2,  Z=3
	Circle=CreateMesh()
	surf=CreateSurface(Circle)
	;Bottom
	Dim Prim_Circle(Segments)
	Prim_Circle(0) = AddVertex(surf,0,0,0,.5,.5)
	For S = 1 To Segments
		Angle# = (360/Segments) * (S-1)
		U# = Sin(Angle#)/2 + .5
		V# = Cos(Angle#+180)/2 + .5
		Prim_Circle(S)=AddVertex(surf,Sin(Angle#),0,Cos(Angle#),U,V)
		If s>1 Then
			AddTriangle(surf,Prim_Circle(0),Prim_Circle(s-1),Prim_Circle(s))
		End If 
	Next
	AddTriangle(surf,Prim_Circle(0),Prim_Circle(Segments),Prim_Circle(1))
	
	If Axis = 1 Then
		RotateMesh Circle,0,0,90
	Else If Axis = 3 Then
		RotateMesh Circle,-90,0,0
	End If

	UpdateNormals Circle
	EntityFX Circle,4
	If ParentEntity > 0 Then EntityParent(Circle,ParentEntity)
	Return Circle
End Function



Damien Sturdy(Posted 2004) [#53]
nice work!

Plop it in the code archives, i will do the same!
Just adding better envelope support so any envelope can play on any channel :D


RiverRatt(Posted 2004) [#54]
Hey thats a nice game! Good work on the sound. Something I have to get into a little more.


Damien Sturdy(Posted 2004) [#55]
IM just tidying up the sound module then im gona release it on 'ere ^.^ just installing LFOs :D


Damien Sturdy(Posted 2004) [#56]
Ive updated the demo. The game is the same, but anyone who liked the sound system, redownload... ive organised it better and added LFO's ^.^ feel free to use it wherever, whenever. Just credit me okay? ^.^ Catch y'all later.


Damien Sturdy(Posted 2004) [#57]
Dude/dudettes.... I'm afraid it looks like im going to have to back out of this compo- My drive just threw a wobbly and i just lost this weeks work :(...... oh well..


Oh, and now i feel like c**p- i had a right surprise for this comunity coming too :(


Damien Sturdy(Posted 2004) [#58]
well, after some long hours, and a program Eikon recommended, i recovered my lost files... Backing up the rest of the drives now- il do my best to finish this tomorow- Doesnt look likely though!!!!


Damien Sturdy(Posted 2004) [#59]
this is as far as im gona get: So, heres my submission.....

http://www.blitzbasic.com/codearcs/codearcs.php?code=1188


Craig H. Nisbet(Posted 2004) [#60]
So now that comp is done, we have to figure out how to judge it. I personally think that Cygnus's is the best.


RiverRatt(Posted 2004) [#61]
I agree. Cygnus's is the most complete.


Damien Sturdy(Posted 2004) [#62]
Cheers lads! i did throw the last bits together though.... i spent the same amount of time on the sound system and on the game.. :D

I hope everyone else votes for me too! hehe. I hope to see you lots entries soon... i enjoy seeing what others are capable of- usually lots to learn!

Have fun!