Jump to content
Sign in to follow this  
  • entries
    298
  • comments
    1135
  • views
    232378

More painstaking code'n

Sign in to follow this  
HopeDagger

95 views

Layering

Doing proper layering in 2D games sucks. Period. It seems like sprites keep on getting mislayered with other sprites. Object shadows are now properly layered, but they eat up more CPU power now, since they are essentially just normal sprites with color (0,0,0,128). I'm going to have to play with my drawing order some more. Something like this would be ideal:

1) Ground (grass, snow, sand, whatever)
2) Tiles (paths, floors, walls, etc)
3) Wall shadows
4) Sprite shadows
5) Sprites (players, bullets, trees, boxes, etc)
6) HUD stuff

Right now player names and healthbars render on the same layer as the player, so names/healthbars vanish under trees and boxes oftentimes. Very annoying. :P


Not null, but not valid either

I finally realized where a lot of the access violation errors I've been getting are coming from. I was under the impression -- for whatever reason -- that Delphi had a primitive-ish garbage collection system that would generally take care of nulling out pointers/objects for me. I was wrong. Thus all of my nice "if blah <> nil then" checks were in vain. Well, not all of them, but several. I can catch if they are null, but not if they point to data that is now invalid. Doh. This is catching a lot on respawn-point lists and outgoing exposives (mines, claymores, etc) lists. Some more fun there. Makes me want to use C# or Java something fierce.


Miscellaneous

And some more random bugs with (the newly added) team-chat, player joining (again!), mines/claymores detonating on dead players, and enigmatic bad packet headers.


I know I'm complaining, but I need to vent somehow. Who better than the readers of my journal? :P (Hehe, sorry, you guys know it's nothing personal :P)


Arctic Outpost: new map!

Our first fan-map has been created by DarkCampainger (yes, intentional mispelling): "Artic Outpost". It's a very attractive Free-For-All map with lots of tight corridors and rooms, as well as a nice open area for bigger brawls. Here's some random screens:






Awesome work, DC! [smile]
Sign in to follow this  


4 Comments


Recommended Comments

Perhaps your mispelling of "Campaigner" was intentional, but your mispelling of "Arctic Outpost" was not. [smile]

Share this comment


Link to comment
I've played this map and it's good fun!

I've also thrown together a few silly maps myself but I'll have to catch you online at some point to give you them :D

p.s. I like the names hiding under trees, you can do some real sneaky ambushes like that :D

Share this comment


Link to comment
@Samsonite: Hehe. He originally spelt it "Artic Outpost" originally, and it got stuck in my head after having to do a few renaming to the proper word. But now I'll edit it out and nobody has to know. [grin]

@Metorical: The names will still be hidden when you're under trees -- that's not layering, but rather another intentional hiding of the name/healthbar.

@Rob: I'll have to go through each player/sprite beforehand and draw the shadows before and objects/players are drawn. Right now I'm just sticking in the shadow drawing in the line beneath the current draw code in the sprite's Draw procedure. Something ugly like this:


procedure TMapObject.Draw; override;
var
oldCol: TOmegaColor;
begin
oldCol := Self.Color;
Self.SetColor( 0,0,0, 128 );
Inherited; // Draws normally, but at shadow-colour
Self.SetColor( oldCol );
Inherited; // Draws normally, at real colours
end;



Basically it was just laziness on my end, since putting it in there was so much easier than actually doing it properly. [grin] But luckily since us coders are renowned for our laziness, nobody should be too tiffed at me about it. :P

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!