Saturday, September 18, 2010

Added height differences in FPS engine

Recently I have been talking about a simple 3d engine
that I have been placing together to use in flash games
(mainly first person shooters).
I have just added floor and ceiling height differences to
the engine and it seems to be working quite fine...
 As you can see; the
engine is still running
off a 2d grid based
engine similar to
wolfenstein3d, but now
that it has height
differences it's a bit
more interesting.

Currently the textures
haven't been fitted
properly to the
extrusions, but that
won't be much of a
hassle at all to fix.

My biggest problem will probably be rewriting the enemy AI and collision
code, but that's okay since (as you would of seen if you played the tech demo),
I already needed to update that. The enemies should be able to detect if a floor
tile is too high to walk onto (creating a wall) or if it is too low (creating a drop).
They should be able to walk up stair cases and so on as well...

I'd love to be working on this more, but unfortunately I'm WAY behind at Uni...
Luckily though, my break is in 4 weeks, so if I'm a good li'l art student and get
a passing grade, I'll be able to finish this very soon when I get my break.

Feel free to leave any comments or suggestions.

Saturday, September 11, 2010

Finally released tech demo for FPS (Generic FPS)

Well, I finally released the tech demo of my FPS engine on newgrounds....
Play "Generic FPS" on newgrounds

I figure the actual engine is quite stable, but unfortunately the texture work
and other graphics are somewhat poor... This all needs to be updated.
I'm thinking in the later version I might push the wall textures up to 100x100
instead of the 50x50 I'm currently using... I've done a test and it seemed to
run at around the same frame rate... I didn't notice any speed difference at
all really.
 I've just made the
textures repeat in
this screenshot,
but (in theory)
running the game
with 100x100
textures should be
perfectly fine.

Another idea I'm
thinking of adding to
the engine is height
differences in floors
and roof tiles.


Pretty much this will work by saving the map files into arrays that are
objects... each object (2d map location) will hold the tile type, the roof
height, floor height and so on, unless it is a solid wall, in which case the
heights aren't required and will be rendered in context to the surrounding
tiles. I'm not sure if I'll encorporate this into the current engine for the
upcoming project, or have it in a sort of "gFPSII engine" for later projects.
In theory this will make it alot more like the system shock 1 engine (but
without slanted floor tiles, bridges and so on)...

The reference to System shock brings up another addition I wish to add...
A mouse system... but no; not one for aiming... Like I said: Not a fan of that
when it comes to flash games... but more of an adventure game styled mouse
interface... of course this isn't going to be used in the upcoming shooter...
I do actually want to keep this one quite simple...

But I am hoping to adapt "H.P. Lovecraft's The Hound" into a flash game
for a class I have for University... Well, I say "game", but it's more of an
interactive graphic novel sort of thing... a very short one... I want the 3d walkable
parts of the game to incorporate a modified version of this engine with the addition
of a mouse select... like those "point and click" flash games we've all played.

Well, I have to take apart the engine now because I wrote the basis over one
night then just kept adding to it... so I want to take apart all the functions into
separate files so that it will be easier to modify... it's a bit all over the place
right now.

I might even release some tutorials on how to replicate this engine after I've
finished it and released a game or two... I sort of wanna try to get some
sponsorship for at least one of them... but after that I'll release a tutorial or
two... maybe even the source code... but I wouldn't want people to just
use my engine directly... I wouldn't mind, but I'd prefer people learn how
to make their own... It's more rewarding for them that way.

Well... any feedback or suggestions for the upcoming first person shooter,
or anything else I've mentioned... or if anyone is interested in helping out;
please do leave a comment.

Wednesday, September 1, 2010

Early first person shooter test (in progress)

(demo at bottom of post)
Currently being coded in AS3; my second attempt at a AS3
game (first being the "Never Ending Shooty-thing" practice game).
I really should of finished this game ages ago... it's really not a
complicated game to make, and the goal was quite straight forwards...

Just before I switched over to AS3 I started coding what I was
calling the "RIIC" engine (Raccoon Crisis II) in AS2..
As you can see; the engine
didn't include wall textures.
This was because I didn't
know how to do this at
the time and I believed it
would of ran too slow.
This engine worked by
turning 2d vector based
maps into 3d projected
walls... It all ran quite
fast until I added in wall
collision detection and
tried to make modest
sized maps for the game.
I ended up rewriting the
collision code many times
in an attempt to make it run faster, but I came to the conclusion that AS2 just
wasn't fast enough (well, when running on my crappy notebook).

After coming to this conclusion I decided to code an engine closer to the
old-school wolfenstien 3d styled raycasters... I still used vectors to create
the walls, but it was closer to Ultima underworlds block based maps (but
alot more simple). Once making a map viewer with textures (yup... I did
some research), I came to the conclusion that it was too slow... sure; it
would of ran fine on a faster computer, but I don't want to make casual flash
games that require "good" computers... I want it to work on more peoples
computers... so I decided to bite the bullet and learn AS3.

Luckily for me; AS3 wasn't such a jump... infact I found it more logical and
alot nicer to work with than AS2... it reminded me of C++ in alot of ways.
I taught myself the basics over 5 days (yes; the NEST game)... then went
straight to work on converting the last engine I was working on in AS2 to
AS3.

The basis of the engine
were written on the first
day... but because of
University and sickness;
I fell behind in my
programming and only
recently got back to the
project. Currently it has
one kind of monster, a
default weapon, operatable
doors and stereo sound.

Alot really needs to be
added, but these are very
small things that won't take much time... well... the graphics will actually... I've set
up an annoying process for myself (yes; silly me).

I'm hoping to have a playable demo ready very soon (more playable than the one
I'm adding at the bottom of this blog entry) which will have more map tile textures,
life, a life bar (so yes; a way to die!), coloured keys for coloured doors and an exit
for the level.

In the Final version I want at least 2 more monster types, two more kinds of gun and
a lot of levels... Maybe a survival mode like Raccoon Crisis and highscore tables.

You're probably wondering why this is so primitive compared to alot of other 3d
flash engines out currently... Well that's simple:
1. I wasn't aware how much faster AS3 is than AS2 when I started coding this.

2. I wanted to make something that runs fast on most computers... the problem with
alot of these newer engines is that you require alot to get them running... sure; the
tech demos seem fast, but when adding in the further complications of a games logic
(collision detection, multiple animated objects, physics, particles and so on), you
might notice a bit of a slowdown... but if you have a cheap notebook like me;
A MASSIVE SLOWDOWN! So I wanted to just make something most people
can play.

Well, hopefully this will be done soon so I can move onto bigger and better things...
I hope you enjoy the tech demo:
...demo removed...

Tuesday, August 31, 2010

Never Ending Shooty-Thing (Already completed)

This was originally coded to help me learn AS3.
It was made over 4-5 days.
The game is pretty much one map
where little red guys with guns keep
spawning into the room. A maximum
of 15 red guys can be in the room at
once. You have a pistol that has
infinite ammo and can collect grenades
which you can throw and they shoot out a small wave of
bullets going in all directions. You have 5 lives and
continue playing until your lives are used up then you
can submit a highscore (thanks to Mochimedia highscore
tables; which I also used in Raccoon Crisis).

This game didn't really get high ratings, but alot of people
enjoyed playing it... I presume this was because it was
quite easy to play and really easy to get a highscore.

It had a somewhat stable engine, the only flaw being a glitch
caused by me not coding that the amount of red guys in the
room is reset once you die meaning if you try to replay after
dying nothing spawns... yeah; a pretty big glitch actually.

The sprites were made using a laser mouse because I had
left my tablet at my brothers, the background was an old
painting I did (an oil painting called "the most frustrated state
of calm", the first painting I ever sold) and the music was
something I composed for an animation for Uni.

Overall it was nothing amazing, but it's a fun li'l time waster
and was a great way to teach myself AS3.

Never Ending Shooty-Thing (or NEST) can be played here:
Play Never Ending Shooty-Thing on NewGrounds!

Raccoon Crisis (already completed)

Raccoon Crisis was my second attempt at a flash game.
It was coded in AS2.

As you can see; the game has
a VERY primitive 3d engine...
There were 15 levels in "story
mode" (which hardly had any
story apart from the you having
to kill zombie raccoons that
for some weird reason are
the size of people and have
guns....), and 1 level for
survival mode (which never
ends).
There were 4 kinds of monster
and 3 kinds of gun.
The game was never really
successful, but it has had
over 30,000 plays... but this
is mainly thanks to it being uploaded to Chinese servers at some point.

I think the two main problems with the game were:

1. It was too DAMN hard! Those li'l jumping raccoons ran too fast....
    I coded this before really thinking about including frame skipping
    code and I coded most of it on my REALLY slow notebook so
    I had no clue how fast they ran until I already finished it!

2. I had a lot of complaints about people not understanding the controls...
    (up and down for forwards and back, left and right to turn, A & D to strafe
    and space to shoot).

Quite frankly I knew the controls were odd, but I still refuse to use a mouse to
turn and look in a flash game... It's a stupid thing to use! Many people suggested
this but I've pretty much ignored it because I know how frustrating it is... If you
click outside of a flash window, you're no longer controlling the game. I also
decided early on that I won't use a mouse for anything other than mouse based
games because most casual gamers use notebooks, laptops & macbooks and
trying to use their internal mouse thingy for a FPS is frustrating, so I had those
people in mind.

The music was mostly composed by my friend "Awista", who I had done alot
of imagery for his band, so I guess it made sense that he could do music for my
game. He composed all the music for the "story mode" and I composed the
piece for survival mode.
Awista's music sounds a bit scratchy in the game, but this isn't his fault...
He recorded it quite well, but since this was only my second flash game
I knew very little about compatible sound formats and ended up losing
alot of quality in my format conversions.

I had tried to get this game sponsored, but looking back on it I understand
why I didn't get one... it was very rushed and I was still learning. I had a
few expressions of interest, but they were more interested in where I'd go
after this with a bit more experience.

If you are interested, the game can be played at:
Raccon crisis on Newgrounds!

Started my Blog.

I've decided to start this Blog to showcase my games programming work.
This is mainly to keep me interested in my projects and be able to have a nice way of keeping my projects in order. Maybe I'll also use this as a sort of online portfolio, I dunno... We'll see what happens I guess.
Feel free to leave feedback or get in touch with me.
-Kev.