PliGame, R.I.P

Published June 15, 2005
Advertisement
Just to further prove that I'm an unusual "newbie" to game development, I present to you PliGame. This package provides extensions to the Pliant language for the SDL game library. I wrote this. Its even listed on the SDL languages page. I did this as part of my undergraduate thesis.

Pliant uses a JIT like compiler, it compiles Pliant scripts into native code in memory at runtime. My thesis professor, Marcus Santos is one of the core developers of Pliant. I decided that Pliant could perform well as a game programming language and so created PliGame.

I implemented bindings for graphics, event and input function to SDL. This was enough to prove that Pliant, which syntax is as simple as Python ( so some think ) and performs comparibly to C. I found a few demos in C and Python, and wrote similar demos in Pliant. One example was the rotozoomer.

The rotozoomer is simply zooming and rotating a 2^n by 2^n tile bitmap image in and out. I was able to implement this in Pliant in just 92 lines, with comfortable white-spacing. And it performs at full 60FPS.

roto.pli:
Quote:
module "/pliant/language/context.pli"module "/pliant/math/functions.pli"module "/pliant/SDL/SDL.pli"gvar Pointer:SDL_Surface tilegvar Pointer:SDL_Surface screenfunction rotate dest src angle scale arg Pointer:SDL_Surface dest src arg Float angle scale var Int u v du dv x y sx sy mv mu var uInt umask := src:w - 1 var uInt vmask := src:h - 1 var Address texture image var Float temp texture := src:pixels image := dest:pixels sx := 0; sy := 0 du := cast (scale * (cos angle) * 4096.0) Int dv := cast (scale * (sin angle) * 4096.0) Int for  y 0 (dest:h - 1)   u := sx   v := sy   for x 0 (dest:w - 1)    mv := (v \ 2^12 ) .and. vmask    mu := (u \ 2^12 ) .and. umask    (image map uInt8) := (texture map uInt8 (mv * src:w + mu ))    image := (image translate uInt8 1)    u += du    v += dv   sx -= dv   sy += du returnfunction init -> b arg Bool b b := true if (SDL_Init SDL_INIT_VIDEO) < 0  console "Could not initialize SDL!" eol  SDL_QUIT  b := false  return screen :> (SDL_SetVideoMode 640 480 8 SDL_SWSURFACE) if not (exists screen)  console "Could not init video!" eol  SDL_QUIT  b := false  return tile :> SDL_LoadBMP "astroids.bmp" SDL_SetColors screen tile:format:palette:colors 0 tile:format:palette:ncolorsfunction main var SDL_Event event var Float angle := 0.0 if not (init)  console "Init failed..." eol  return var CBool done := false while not done  while SDL_PollEvent:event > 0   if event:type = SDL_QUIT     done := true   eif event:type = SDL_KEYDOWN     done := true  rotate screen tile angle (sin angle)  SDL_UpdateRect screen 0 0 0 0  angle += 0.005 SDL_FreeSurface tile SDL_QUIT returnmain




I made an MPEG video player (w/ SMPEG) and almost wrote a first-person Asteroids game. But I stopped half-way. Had I completed it, that would have been my first game.
                  

I got an A+ for the thesis, and quickly switched to other important business. I never continued the project, and my professor is still looking for thesis students to further develop the Pliant language. Its still complete enough for making games, just without sound.

One of the other reasons I discontinued were the difficulties in supporting both Linux and windows versions. I wanted it to be cross platform, but it appears that the developers of Pliant are more interested in running Pliant in its own operating system, Full-Pliant or Linux.

Window library support was a headache and I just couldn't keep up with all the new changes in the Pliant compiler. I decided that if they can't fully support Windows, then I'd just forget about gaming applications for Pliant. I hate MS as much as the next guy, but I can't ignore the fact that gaming is hot on Windows and not Linux, unfortunate as that is.

So yes, I do indeed know SDL. And I've never made a game with it. I'm still a newbie.
Previous Entry I can't blog.
Next Entry Out of the Country.
0 likes 2 comments

Comments

Rob Loach
Hey, I noticed that you're in Toronto so I sent you an invite to GDNet Toronto...
June 18, 2005 09:31 AM
EnemyBoss
Thanks, I got it.
June 19, 2005 01:36 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement