Quantcast
Destructoid - doctor insidious's Community Blog




About Me
Hi, my name is Matt, but you can call me doctor insidious, because that is much more awesome.
My top ten games:
10. SBCG4AP
9. Sam and Max
8. Gears 2
7. Tap Tap Revenge
6. We <3 Katamari
5. Castle Crashers
4. Persona 3
3. Braid
2. Crayon Physics
1. Cave Story

I am one of the few people who actually know how to program in this world. And by program I mean know how to use pointers.

#include <stdio.h>

#define COCKS 0

int main (int argc, char **argv)
{
printf("Hi I'm doctor insidious\n"
"This is the most useless program I have ever seen\n");
return COCKS;
}
Gamer Profile
3DS friend code:
Steam:
Battle:
PSN:
Mii:
Gamertag:
Following (12)
Chad Concelmo
Hamza CTZ Aziz
Jim Sterling
mix
Mr Gilder
Niero
Occams electric toothbrush
randombullseye
seigfreid
shipero
Tray Ben
TSuereth
Designing a game engine, part 1.5 (short blog)
doctor insidious | 10:38 PM on 11.17.2009 9 comments


*Note, I am writing this blog in haste because I have a lot of stuff to do I have school tomorrow so please excuse all run-on sentences. That was a joke, but seriously, I didn't have time to really proof this too well.

Well, I think most of the seven of you who remember last blog post recall that I was programming a game engine using the GNU library guile, which basically is a Scheme interpreter for C code. Well, unfortunately guile is not reentrant, meaning it can't handle multiple threads. What are threads? Threading is a concept in which allows multiple processes to be handled at the same time. This is critical for game engines, because a good game engine has to handle both user input and drawing stuff on the screen at the same time. This forced myself to write my own interpreted engine from scratch. I started yesterday, and finished today (aside from missing primitives the most important being "if"), and thought I'd show you guys the result. Note: PLEASE DEAR GOD DON'T MODEL YOUR LANGUAGE AFTER MINE. Not because of copyright or anything, but because you wont have good time trying to use it.
5
This is a number, return that number.
Simple enough, right? Well, it gets more complicated...
*1 4 5
This is a primitive followed by some numbers. This primitive, *1, adds the 2 numbers in front of it. To add multiple numbers, one must do something like:
*1 *1 5 5 5
This returns 15. Other useful primitives include *0: '=', *2: subtract, *3: multiply and *4: divide. One who has taken geometry at one point can compare primitives to postulates.
*0 @1 5
This assigns the '5' to the 1 place in the variable stack. Notice how I don't say the "first place" in the variable stack. That would be 0.
*1 @1 3
This is equal to eight.
[2 *1 6 7]
This defines the procedure '2'. Most of you will probably think: didn't he mean to write "functions"? No, there's a difference in my language. Functions take arguments, procedures do not. You can not pass arguments in my language. There's a reason for this, but it's more like an excuse.
$2
Calls the procedure 2 and returns 13.
*1 *3 $2 @1 5
Returns 70
Well, that's pretty much it. I just finished so I thought it would be cool to show you. I remember you all got a kick out of the (x86?) Assembly I showed you, so I thought I'd make the language as annoying as possible to express. Finally, the game engine will be called: The Berry Engine, named after my good friend TheRedPepperofDoom, who's birthday is tomorrow. Happy birthday!



Is this post awesome? Vote it up!

1

Those who have fapped:  Jon B  


Post a comment! You can also post a photo below:

Comment with Facebook





Click connect and comment instantly!

Comment with Dtoid





New? SIGN UP - it takes 5 seconds

9 comments | showing # 1 to 9
prev next

TSuereth's Avatar - Comment posted on 11/17/2009 23:49
TSuereth
Polish notation! Neat. I admire your continued refusal of C programming, and also that you're already hitting on the concept of thread safety (something many highly-paid engineers I've met still have a regrettably poor grasp of).

Impressive, young Skywalker.
Jon B's Avatar - Comment posted on 11/18/2009 00:32
Jon B
I got about halfway through that then I saw numbers and my head exploded everywhere. You're certainly a hell of a lot better with code than I am.
doctor insidious's Avatar - Comment posted on 11/18/2009 00:43
doctor insidious
Interesting little bug: infinite recursion is impossable due to the procedures getting stored in arrays, so doing something like:
>>>[1 $2]
>>>[2 $1]
>>>$1
Instead of looping forever, the program segfaults.
BulletTrain's Avatar - Comment posted on 11/18/2009 12:38
BulletTrain
Yuck, interpreted languages. :/

Did you see the presentation on Go circling the internet a few days ago? Seems like a neat little language. Might be fun to write an engine or an emu in it.
doctor insidious's Avatar - Comment posted on 11/18/2009 17:56
doctor insidious
Go right now is expiremental, and C is also a very low level language, making it ideal for a game engine. Also, the library support for Go isn't too good right now.
BulletTrain's Avatar - Comment posted on 11/18/2009 18:32
BulletTrain
Yeah I know, but it'd still be fun to play with it, considering the way its setup for multiprocessing and the compilation efficiency.

C is nice for when you need speed, but its unwieldy in some cases.

Had to look up what guile was; Any reason for going with a thing that crunches C into scheme?
doctor insidious's Avatar - Comment posted on 11/18/2009 19:18
doctor insidious
I think it's the other way around, crunching scheme into C. Originally I was going to make my engine focused as an educational sort of thing, and scheme is very good for learning about recursive/iterative processes.
seigfreid's Avatar - Comment posted on 12/02/2009 20:59
seigfreid
cool blog bro
prev next

Comment with Facebook





Click connect and comment instantly!

Comment with Dtoid





New? SIGN UP - it takes 5 seconds

Comments policy

Destructoid is an open discussion community. You don't need to "audition" to post a comment - just speak your mind. We respect differing opinions on the site, so have at it. Be smart, funny, insightful, clueless, or cute -- but back it up with substance. Keep your cool, keep it fun. We only ask that you act respectfully and above all: don't be a troll and ruin it for everyone else. Don't bring down gamers or we'll, you know, gently shoot you in the face and stuff you into a flaming mailbox. Each comment is your opportuntity to make this community awesomer. Is that even a word?

Avoiding the banhammer only requires common sense: spamming, trolling, racism, NSFW stuff, and other forms of sucking will not be tolerated. If anyone is griefing please report abuse. Be good. Don't suck!