GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - Phonecord
View previous topic :: View next topic  
Author Message
I_are_n00b
Member

Joined: 12 Oct 2005
Posts: 88
Location: Houston, Texas
PostPosted: Thu Mar 13, 2008 6:50 pm    Post subject: Development Log - Phonecord Reply with quote

It's Spring Break and i'm picking up my on and off project. I guess I'll start a dev log since it seems like everyone else has one and my momma always taught me to always copy what other people do.
Project PhoneCord
What?
A science fiction action RPG with a console style/feel. No mouse support just keyboard or joypad.
Why?
Because there aren't enough.
How?
C# and Managed DirectX. At first it was Managed DirectDraw... but then I realized I needed rotations so I switched to Direct3D. Too bad this was started before XNA was released so I'm still using DX9.
When?
Started maybe 2 years ago... on and off, mostly off. I think I posted a screen a loooong time ago and got someone called me out for using RPGMaker graphics.
Who?
Just me for now.
What's that last one?... whatever...

Goals:
-Make a reusable object oriented engine. Although I'm sure the next project I start, I'll probably do from scratch. Damn you software engineering class.
-Make it fast paced and science fiction with high resolution 2D graphics (I'll make them myself if I have to damnit).
-FINISH.

Progress:
-Maps
-Objects
-NPCs
-Scripting
-Projectiles
-Stat system
-MessageBoxes (even though they are a little messed up)

To Do:
-Remake map editor to have all the new features.
-Design for the actual game.
-Vehicles.
-Main Menu, item handling, equiment, all that RPG stuff.


Now what everyone scrolls past to get to:
...I dont' have any screen shots that aren't either really old or in the video.

Video:
http://www.dailymotion.com/I_are_n00b/video/x4pe7f_project-phonecord_videogames
This video feature stolen graphics but by someone who posted it online for free use.[/b]
_________________
http://www.optionalquest.com
View user's profile Send private message Visit poster's website AIM Address
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4984
Location: Silicon Valley!
PostPosted: Fri Mar 14, 2008 3:23 am    Post subject: Reply with quote

Looks like you have a lot of the basics of a walkaround engine working there. Pretty neat. If you're going to be rewriting the editor, though; do you think it might be useful to convert the code into XNA? I honestly can't believe I'm suggesting such a thing, myself as with Neverfall I definitely don't want to rewrite *any* code to solve the problems I'm facing (maybe it's time I heed my own suggestions).

Do you already know what the main storyline/plot is going to be for this?
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9432
Location: Not Finland
PostPosted: Fri Mar 14, 2008 7:46 am    Post subject: Reply with quote

Hey, a fresh RPG walkaround demo! It's been a long time since I've seen one of those.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
xearthianx
Developer

Joined: 28 Sep 2006
Posts: 771
Location: USA! USA!
PostPosted: Fri Mar 14, 2008 12:16 pm    Post subject: Reply with quote

I'm sure some people would have a thing or two to say about XNA, but if you're already using C# and DirectX, I don't think vendor lock-in is much of an issue for you. I developed a phreaking tool a while back for Windows Mobile 2003, and I must say I have heard the siren call of .NET. Certainly, it's nicer to work in than Java.

I think the two most important things to ask here are (A) How much effort will it be to convert the existing codebase for XNA? and (B) Is the potential benefit worth all that extra effort? Once you've answered those questions, you will know what to do.
_________________
Ionoclast Laboratories - Scientia et Dominatia!
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Bean
Admin

Joined: 20 Aug 2005
Posts: 3769

PostPosted: Fri Mar 14, 2008 4:01 pm    Post subject: Reply with quote

You did a wise thing not using Direct Draw. Not only is it limiting but it's Really slow. I did a game awhile back (Silent Chaos), that had a similar engine and man did it crawl do to my use of DirectDraw. After 4 years I never completed it. To this day I toy with the idea of rewriting it in Direct3D.

Good luck with this. If you made it this far, you may actually finish it!


-Bean
_________________
Kevin Reems | Nuclear Playground | Solid Driver
View user's profile Send private message Visit poster's website
I_are_n00b
Member

Joined: 12 Oct 2005
Posts: 88
Location: Houston, Texas
PostPosted: Fri Mar 14, 2008 10:48 pm    Post subject: Reply with quote

Originally when I was doing the game with DirectDraw, the objects would handle its own draw. That method was not very sound so now all the objects do is pass a DrawData class and the game processes it.
There's only 2 files with any DirectX code in them, so switching over to XNA would be easy. However, are there any actual benefits to switching to XNA other than being able to release for the 360?

I have a general idea for the plot but I wanted to stay away from hammering it out because from what I found in the past it's a project killer. I don't even know the capability of my engine yet so there's no point in plot details.

Progress
I've worked very hard to make this engine reusable. There are two projects, one is the DLL, with all the objects and the other is the "Game" project. There's a third for the map editor but it's a very very old version (still uses DDraw actually...) and has no room to incorporate the things I've added (it can only make multi-layered tiles maps right now). My design decisions so far have all been centered around making this thing as reusable as possible. There are no implemented RPG stats for the game, instead there are Hashtables where someone can make up whatever stats they want. I didn't want any hard coded mechanics in the DLL files, so I made any game-math related things to depend on interfaces that might be implemented in another project. I originally though about having the editor give you control over game math, but this would involve parsing an equation out of a string every time something needed to be calculated. So I ended up with the current design, where if you want to mod this into a different game altogether, you'll have to implement some interfaces.

This method is really hard to test since I don't have an editor. Everything you saw on the video was typed. I had to add each script element to the script array, create every character and NPC. That wasn't so bad but trying to make up stats and putting them into hashtables then testing out the interface method was a pain. That's basically what I spent all day doing today. Like I said, I had projectiles implemented, but there are no rules to generating them. I just finished setting up weapons and loading stats in them (firing delay) so it'd work.

Game Design Decisions
-There are two ways to target. One is the standad Zelda-like system where you have up, down, left and right which is fast and intuitive. This works great for fast change of directions and for melee classes this is porbably all you'll have to use. If you press control or shift or whatever, it'll bring to angles mode where left and right turns you and up and down moves up in the direction you're turned. This allows ranged weapons to be more accurate.
-Because I didn't want the mouse in this game, spells that target areas weren't going to be as easy to implement. So instead, when you press down attack, I'll have a cursor move further and further away from you. When you let go, the spell/attack will then go off wherever the cursor was. You can use the previous methods to target.

All this is an attempt to make the game fast paced and console like without the click fest. I want this to have a sci fi feel to it, so when you get a machine gun, you can actually hold it down and it'll fire rapidly as opposed to Phantasy Star Online and Anarchy Online's lame "automatic" weapons.

I'm also thinking about making certain guns the same damage no matter what. The difference is the percentage it'll hit. This is just because it'd make sense, not because it'd be more fun or anything. It may not happen.

Lastly, vehicles. Since it's sci fi I want the game to have both land, air and space vehicles. Land and air are pretty easy since I have the whole rotation thing implemented already. However, for space, I'll probably need to think up content and a reason for the player to actually be travelling through space to planets instead of teleporting.

Need some advice:
-So I have all the objects pass along drawing data. One of these is the filename for the graphic file. Right now I have a texture manager that loads textures into a hashtable with the filename as the key. This way, two objects with the same graphic set only needs to be loaded once. However, theoretically this hashtable would grow infinitely. I'm wondering when I should clear the hashtable. After a level transition? Fixed size? Etc... Any advice? Should I write something that checks all currently loaded graphics and remove all the keys that aren't used? If so, when do I run this function?

-Okay, so right now, I have "attachable" graphics. This includes cursors for targetting, health bars etc... It's just an arraylist of drawable objects in each player. The same concept applies to attachable equipment. If I draw the player holding the gun while he's walking, or firing, I'll need to know which to draw on top of which. The problem is, if the player is moving downwards for exmaple, the gun should be on top but if the player is moving upwards, the gun should be drawn under the player. This can change on a case by case basis. What is a good solution to this problem?

-I have rotating objects but so far I've been using arrays of Rects (with Rect.Intersect) as collision boxes for each object. If I'm rotating these objects, am I forced to write my own collision stuff? Any good references on this?

Edit:
Oh yeah, Silent Chaos looked pretty fun. Was it really the techhnical stuff that kept you from finishing?
_________________
http://www.optionalquest.com
View user's profile Send private message Visit poster's website AIM Address
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10833
Location: Canadia
PostPosted: Fri Mar 14, 2008 11:21 pm    Post subject: Reply with quote

Quote:
Need some advice:

1. Your graphics don't look that high res, so you can probably get away with just loading and leaving everything. If it does become a problem, here's a few things you can do to optimize that (each building off the last). Doing just the first

Track a list of your textures, moving the most recently accessed to the top of a list. When you need more room, free the oldest textures until you have enough.

If VRAM Free's are slow, and you're concerned about the loading performance once memory gets full, timestamp your textures. And during "dead time" (once a frame, or once every couple), free a texture of a certain minimum age from the list. Take note, I said "a" texture, not multiple. By freeing 1 texture per frame, after only 1 second you'll have free'd 60 textures (assuming 60 fps).

To improve cachability (or if your texture sizes are unpredictably small or large), track your VRAM usage (assuming you don't have a function, add to a "VRAM_USED" variable every load, subtract every free), and only unload textures to a certain threshold. In other words, lets say the maximum amount of VRAM you want to use is 24 MB. Simply stop yourself from "automatically" freeing a texture, once texture usage drops to about 16 MB. This also gives you a foundation for VRAM memory leak checking.

2. Have guns and other overlays as part of character animation frames. That way, an overlay is not limited to always being "on top" in say, a walk cycle. After all, arms may swing in front, or behind, depending on the view (thusly obstructing the item carried).

Place "sprite sockets" on or behind a character, where each asset has an anchor point, and each graphic can be drawn relative to the anchor to suit it's shape. To make things easy, make your anchor the center of the texture. Sure, that may be wasteful, but you can always write a post process that clips it and generates the optimized co-ordinates later.

You can generalize the socket idea by treating character art also as a socketed graphic, making animation frames collections of sockets. That also means, so long as you're happy with the size and build of a character, you could change his race with a palette shifted graphic (or with vertex colors).
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar


Edited by PoV on Fri Mar 14, 2008 11:45 pm; edited 1 time
View user's profile Send private message
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Fri Mar 14, 2008 11:44 pm    Post subject: Reply with quote

PoV wrote:

2. Have guns and other overlays as part of character animation frames. That way, an overlay is not limited to always being "on top" in say, a walk cycle. After all, arms may swing in front, or behind, depending on the view (thusly obstructing the item carried).


Explain? For a customizable game with lots of weapons, he can't possibly make an animation sheet for every gun attached to each character?
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10833
Location: Canadia
PostPosted: Sat Mar 15, 2008 12:34 am    Post subject: Reply with quote

And you don't. You make a run cycle holding a generic weapon, and exchange the weapon to suit what you're holding.

To be clear, Animation frames don't contain any art, they instead reference it. To make a modular character building system, we need to break down or concept of an animation. It's a bit complicated, but everything should connect.

Art assets are both the pictures of characters, including all his frames of animation, and the things to place on him in each respected orientation. Each art asset needs to be referenceable in some way, and ideally should be exchangeable. At this level, we're only concerned about being referenced. The game, be it an editor interface or the in game item system, will handle exchanges. So to be referenced, we give each art frame an index, and an asset name.

Animation frames are positions, a master asset index, and an art index. Directly, they're not art, but instead they reference art.

An example art asset, a 256x256 image called "Player.png". "Player.png" is conceptually broken up in to 16 64x64 sub images (4 wide, 4 tall). The art frame is a number from 0-15, and the asset name is "Player.png".

To make an art asset usable, we need to insert it in to an asset table. An asset table is a list of all possibly variations for art assets (gun, sword, etc). "Player.png" becomes the first entry in our asset table, getting an asset index of 0.

To make an asset table usable, we need a master asset table. The point of the master asset table is so we can cleanly add new entries to asset tables without having to rebuild our animations from scratch. Our prior asset table becomes master asset index 0, and our circle is complete.

An editor interface for creating a frame would have a nice way to change and identify Master Asset Indexes, so you can tell what's a body and what's a helmet, what's a body, and so on. Once you make the first animation, the order of your master asset table must stay the same, otherwise you'll break your existing animations. New asset tables can be added on to the end.

Code:
Animation // A collection of frames
- Animation Frame[]
--- Art Position // The "socket" idea
--- Master Asset Index // Weapons, bodies, helmets, etc...
--- Art Index // Which frame under the Art Asset

Art Asset // An image file with a name
- Art Index[] // Implied by their position in the graphic

Asset Table // grouping Art Assets together. Every helmet graphic.
- Art Asset[]
--- Asset Index // Used by the master asset table

Master Asset Table // grouping Asset tables.  Helmets, Bodies, Weapons.
- Asset Table[]
--- Master Asset Index // Used by an animation frame to pick if it's a body, hemet, etc.


It's then up to you to pick which helmet he's wearing, which body is his, and so on. The above is just how you'd implement such a system where you can exchange the parts. You still need to pick them.

----

This is one of those situations where it's *MUCH* easier to do in 3D. Change a texture to add variety to vertex animation. Or change a model too, if you have bone animation. Place and animate sockets as part of the animations to have them grip a sword, anchoring them to the character. No need to worry about sorting the sockets, since the Z buffer will do it.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Sat Mar 15, 2008 2:48 am    Post subject: Reply with quote

Ah, yes, that's the way we do it in the game I've been dropping hints of. We use xml files to store the info.

It's still a bitch for me as an artist to make sure all the assets fit together. I can't have oddly shaped armors, or they won't fit with other oddly shaped pants.

I_are_n00b is going to have it easier though, since he only needs to fit weapons on a base that doesn't change...
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10833
Location: Canadia
PostPosted: Sat Mar 15, 2008 12:44 pm    Post subject: Reply with quote

Well, I hope you have a tool to work with, instead of editing the XML's directly. That's a lot of work. ;)
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Sun Mar 16, 2008 8:50 am    Post subject: Reply with quote

Tool is there :)

Also, we have a level editor that supports a fuckton (!) of features...
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Sun Mar 16, 2008 11:18 am    Post subject: Reply with quote

Boy I wouldn't have believed you but then you put the swear word in there!
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
xearthianx
Developer

Joined: 28 Sep 2006
Posts: 771
Location: USA! USA!
PostPosted: Sun Mar 16, 2008 1:01 pm    Post subject: Reply with quote

Gil wrote:
. . . a fuckton (!) of features . . .

Since you're European, I'm gonna go ahead and assume that you mean a metric fucktonne ;)
_________________
Ionoclast Laboratories - Scientia et Dominatia!
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Adam C. Clifton
Contributor

Joined: 04 Nov 2005
Posts: 221

PostPosted: Tue Mar 18, 2008 3:22 am    Post subject: Reply with quote

xearthianx wrote:
Gil wrote:
. . . a fuckton (!) of features . . .

Since you're European, I'm gonna go ahead and assume that you mean a metric fucktonne ;)
Is that more or less than a cubic assload?
View user's profile Send private message Visit poster's website
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Tue Mar 18, 2008 4:50 am    Post subject: Reply with quote

I think you may have to carry the "1" there...

Enough derailing this thread! To topic!
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
xearthianx
Developer

Joined: 28 Sep 2006
Posts: 771
Location: USA! USA!
PostPosted: Tue Mar 18, 2008 10:42 am    Post subject: Reply with quote

I_are_n00b wrote:
However, for space, I'll probably need to think up content and a reason for the player to actually be travelling through space to planets instead of teleporting.

How about "They don't have that technology"? :)
_________________
Ionoclast Laboratories - Scientia et Dominatia!
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - Phonecord

Use this link to get a Sign-On Bonus when you get started!

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.