Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / A simple space miner game with physx

Author
Message
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 14th Oct 2008 22:20 Edited at: 25th Oct 2008 02:56
I'm doing this mostly as a tech demo to teach myself how to use physx in a constructive manner, entirely from scratch. Also, to teach myself how to better manage objects, sounds, etc.

Eventually I'm hoping to make a really complex game based on this, but for now I'm just teaching myself.

WASD moves you around, you point and click to fire. The latest addition is making debri from destroyed targets that you can pick up for points.

Please respect the license.txt file. I have permission to use all of the media files involved, and to distribute them with a game, but not to allow other people to reuse them in their own works. The license.txt file talks about which files are which, and how to obtain a license if you want to use those files.

I apologise for the bland, literally "primitive" models. They're place holders. I have a lot of plans for what to do with the game visually, but I'm working on getting the gameplay in place before I do anything visually special.

Latest changes:
Oct 18, 2008
Fixed a problem where bullets and pickups occasionally went out of reach of the 2d plane that the player travels on.
Added a bit of non-shader motionblur and added extra paralax layers for the starfield.

Oct 20, 2008
Replaced all my cheap hacks for calculating angles with real honest to goodness trig.
Added a gravity well generator to the player's craft. Hold right mouse button to use. It only works on the spewed points from blowing up targets right now. This was done without using Dark Physics' forcefield generators. Mainly to see how hard it would be.

Oct 24, 2008
Made the gravity well a permenant effect on the player.
Added an AI that flies around and shoots at the player.
Added player health.
Removed the music to save on upload/download time.
Changed the player model to a fighter craft.
Gave the new AI a model as well.
Changed most of the sounds so they're less jarring.
Added source code to the archive.
Added the ability to zoom the camera with the mousewheel.

This is the last public update I'm making with source code in it. Hopefully some newbies can learn from this, despite the horrible lack of comments.



Everything I needed to know about trigonometry, I learned by becoming a game programmer.

Attachments

Login to view attachments
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 14th Oct 2008 22:43 Edited at: 14th Oct 2008 22:43
Cool! It's definitely a great start. I'm looking forward to seeing what you can do with it.

DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 14th Oct 2008 23:14
You will need some screenshots if you want to keep this thread open. I tried to run it but was getting some errors because I don't have the Physx drivers on this computer.


DBPro, limited by the programmer.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 14th Oct 2008 23:26 Edited at: 14th Oct 2008 23:32
sorry, I'll edit and post some screenshots, as well as post a small update

Seriously though, I did say "physx" in the title and the post.
sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 14th Oct 2008 23:32
I was going to post on the physic and AI thread but you moved.

nice one this could be made in to a good game like geometry war, hope it all pans out.

is there any reasan as to way you didn`t add code for this, I meen its at such an basic stage, what would you be giving away or lossing?

a lot of newbes could learn from this, I`m not saying you should be cos I can undersatnd way you would keep the code out, but if your going to make a game from it then you could learn more by giving basic code away, and asking question, as to what you should do with or what others did with it.

but I don`t wont to upset you, so if you don`t wont to say then don`t.

ever way it was a good demo, can`t wait to see what you do with it, good luck.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 14th Oct 2008 23:37 Edited at: 14th Oct 2008 23:39
Quote: "is there any reasan as to way you didn`t add code for this, I meen its at such an basic stage, what would you be giving away or lossing?

a lot of newbes could learn from this"


Because I don't comment my code, and so it wouldn't really be much use to newbies. I'm using a lot of array size changing and custom functions for creating objects and playing sounds, as well as garbage collection. Stuff that without comments doesn't make much sense. I would comment, but I've never been good at such things.

Though if anyone wants, when I get a chance, I can post some of my content handling and garbage collection code.
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 15th Oct 2008 00:02
Quote: "Seriously though, I did say "physx" in the title and the post."


I know, I was just explaining why I didn't comment on the game. If I would just have posted "You will need some screenshots if you want to keep this thread open." I would have looked like I was trying to be a "forum lawyer"


DBPro, limited by the programmer.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 15th Oct 2008 00:11
Quote: "I would have looked like I was trying to be a "forum lawyer""


pffft, it's not like you'd be wrong about it... and I'm not as touchy as most people
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Oct 2008 00:50
@ Lucy
Wow, it's definately improved since last time, definately more fun too.

Bug:
Moving on diagonals and firing in the same direction as movement means projectiles collide with your ship again so they disapear with the same sound as a pickup (smaller sphere) being collected by the ship.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 15th Oct 2008 01:09
Quote: "Bug:
Moving on diagonals and firing in the same direction as movement means projectiles collide with your ship again so they disapear with the same sound as a pickup (smaller sphere) being collected by the ship. "


Alright, that's confirmed and I know what's causing it. I'll fix it tomarrow.
sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 15th Oct 2008 02:24
nice one I would love to have a look at you code, if you wont I`ll even help put some basic help notes in your code with you if I can.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 15th Oct 2008 02:56 Edited at: 15th Oct 2008 02:59
Let me fix the bug cowbox mentioned and then I'll post what I have, in all of it's lack of comments and sloppiness...

However, I likely won't be posting much more source code to do with it because I want to use this as a base to make a little $5 sub-bargin-bin indy game. But that'll be quite a bit more advanced... Lots of customizability, levels, visuals, blah blah blah.

The most sounce I'll likely post beyond what I have here (if I ever get beyond what I have here) is a bit of AI that runs around shooting back.
sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 15th Oct 2008 04:06 Edited at: 15th Oct 2008 04:08
ok thanks, I would not expect you to give up more than that.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Oct 2008 12:58
Yes, it has certainly moved on.

I think it would work better if W was "Forward", rather than "Up". So W adds acceleration in the direction the ship is facing, more like Asteroids.

I look forward to the next installment

sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 15th Oct 2008 20:07
I agree with BatVink W as forword would work better.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 19th Oct 2008 09:53 Edited at: 20th Oct 2008 07:11
Here's the source code... Sorry for the delay. I was discussing with an artist that I'm teaming up with the plans for the game. He said that it sounded an aweful lot a cross between "Bubble Tanks 2" from Armor Games and the cellular stage of Spore. So, my husband brought home a copy of Spore and after wrestling out the rootkit it installs, we've been busy playing it.

I've fixed the aforementioned movement bug. Also a bug that can occur if too many sounds play at once (limited to 32 sounds, that should be more than enough). Going to upload the updated binary now. Lastly, fixed a bug that prevented the collision sound from playing when a bullet hit a target ball.

As for the whole WASD movement, I wanted to make it work like Asteroids, but decided against it as I want this game to be casual and not have much of a learning curve for the controls.

Sindore, if you still want to go through and document the code, feel free. Just please post it back here.

Next task is AI, then procedural de/spawning. Basically, as you travel, it spawns a few in the direction you're traveling in if there's none nearby. Frankly, I've no clue how to go about doing that. I mean, I think I have an idea, perhaps using perlin noise.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.

Attachments

Login to view attachments
sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 19th Oct 2008 11:03
@ Lucy I'll have a look at the code latter on in the week thanks, will post it back here in a code so you can look at it an let me know what you think.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 19th Oct 2008 11:53 Edited at: 20th Oct 2008 01:25
Quote: "@ Lucy I'll have a look at the code latter on in the week thanks, will post it back here in a code so you can look at it an let me know what you think."


Groovy. You'll see a few instances of me pointing a dummy object and moving it, then using its position in some fashion. It's because I'm too lazy to memorize the proper trig formulas.

(EDIT)
However, I just reposted the source after converting all of those over to use the proper trig math to do it a less hack'ish fashion.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 22nd Oct 2008 04:40 Edited at: 22nd Oct 2008 04:41
I'm having a ton of trouble trying to get ray casting going. I only want the AIs to be able to shoot if they are actually pointing in the proper direction. However, I also don't want them shooting if there's an obstacle in the way.

Ray casting in Dark Physics is a pain in the ass, see the thread I just posted about it http://forum.thegamecreators.com/?m=forum_view&t=138783&b=30

What's more is I tried sparky's collision dll but it's apparently not updating the position of the objects as they move around in Dark Physics. And to think I saw so many people claiming that mixing the two solves many problems. I honestly don't know what the heck they're thinking both of them are maintaining object positions and rotations mutually exclusive of eachother.

Seriously, you'd think that Dark Physics would at least be able to handle proper ray casting. I've been hammering at this for three days and have posted my results/complaints in the above link.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 22nd Oct 2008 07:34
You could cast your own ray.

I've done this in 2d before, but I'm sure this can be easily replicated in 3d.

Psuedo code:


Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 22nd Oct 2008 09:44
That's not exactly a raycast, it's more of a discrete stepping collision check. I'd rather have a real ray cast function working on PhysX proper. It's actually starting to really tick me off. The ray cast functions in Dark Physics are completely unacceptable. As in they should have been fixed in at least one of the last 5 updates kind of unacceptable.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.
Andrew Neale
16
Years of Service
User Offline
Joined: 14th Aug 2008
Location: the wrong place at the wrong time
Posted: 22nd Oct 2008 09:52
@Lucy - I could be wrong, but I believe there is a command 'sc_updateObject Id' or similar which you need to call when an object changes in some way. Been awhile since I used it I'm afraid, but that may be what you're looking for.
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 22nd Oct 2008 11:23
True true, I guess I don't have a really clear idea of what a Raycast is :p

I know Newton has raycast functions that work, I've used them before. I'm still working on getting it to compile with my DarkGDK program, but it's quite easy to get working with DBPro.

Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 23rd Oct 2008 01:29
Quote: "@Lucy - I could be wrong, but I believe there is a command 'sc_updateObject Id' or similar which you need to call when an object changes in some way. Been awhile since I used it I'm afraid, but that may be what you're looking for. "


Thanks, I'll give that a try once I've had a bit of R&R. I've been banging my head on Dark Physics's messed up ray casting for 3 days. I've emailed Mike Johnson about it and he confirms that there's something funny going on with the ray casting, that it's not working the way it should. I'll try to use Sparky's again until Mike gets the problems fixed.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 24th Oct 2008 03:44
The next edition is almost ready. Just have to clean up how the AIs spawn so that they won't spawn close enough to the player to start shooting as soon as the game starts. Also need to tweak the performance of the space crafts a bit.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 24th Oct 2008 22:52 Edited at: 25th Oct 2008 02:54
Here you go, with working AI. IF your health drops to or below 0%, your position gets reset back to the starting position and you lose 100 points. But otherwise the world is left alone. The AI isn't too bright, it's not meant to be anything more than something to keep you on your toes. Also, picking up points heals your health.

Lastly, mousewheel now zooms the camera in and out.

The source and binaries have been posted in the main archive in the first post.

The binary here has a new spawning system that doesn't require a long load time. It also goes on and on for ever and ever. There's no limits to the world now.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.

Attachments

Login to view attachments
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 28th Oct 2008 00:10 Edited at: 28th Oct 2008 01:06
Latest version is almost like a "create your own space miner" game.

The specs of all the actors and weapons have been moved to an external definition file .datadefinitions.txt

Spread-shot weapons are now possible.

A leveling system has been added in.

New enemy actors can be specified in the definitions.txt file and are automatically added into the game at the appropriate level with a frequency specified in the definition file.

I've included extra models for people to add new AIs to the game, but at current only two AIs and an asteroid are in place.

The sound effects are a little squeaky. I need to make some better ones.

http://fnord.kahlan.org/spaceminer.rar

I'm starting to get very close to where the game engine needs to be before my artist starts making the final game's visuals. The final game will actually be a bit abstract and not make quite as much sense, visually, as this early alpha makes.

Everything I needed to know about trigonometry, I learned by becoming a game programmer.

Login to post a reply

Server time is: 2024-11-24 07:58:51
Your offset time is: 2024-11-24 07:58:51