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.

Code Snippets / Space ship sim with AI

Author
Message
lower logic
18
Years of Service
User Offline
Joined: 15th Jun 2006
Location:
Posted: 29th Dec 2006 06:21 Edited at: 29th Dec 2006 19:31
I've been watching a lot of Battlestar Galactica lately (maybe too much) and I ended up making this barebones spaceship fighter sim with enemy AI. I wouldn't call it a game because I didn't add weapons or a goal, just a minimal amount of physics, controls, camera, and AI. The AI fighters avoid asteroids very well (only rarely going into an asteroid) and they avoid each other most of the time while they all go after you.

Controls:
Pitch and Turn - mouse move. Center mouse on screen to stop all pitching and turning.
Roll - A/D
Thrust - W/S
Vertical movement thrusters - T/G
Left/Right movement thrusters - F/H

Edit: Decreased vertical and side thrusters by 33% and made the AI turn smoothly.
Vampiric
18
Years of Service
User Offline
Joined: 30th Oct 2006
Location:
Posted: 29th Dec 2006 14:07 Edited at: 29th Dec 2006 14:07
Jesus your like the AI king, nice work as always

All bow down to evil
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Dec 2006 15:56
That's great. The AI is very good, almost like a battle scene in a Star Wars movie, and the controls for the ship are excellent too, the way you fly through the asteroids is a really good simulation. However, I just read in the 'Book of General Ignorange' that asteroids are actually thousands of kilometers apart and even seeing on while you're passing through them would be odd, but that's boring for a game

lower logic
18
Years of Service
User Offline
Joined: 15th Jun 2006
Location:
Posted: 29th Dec 2006 19:14
Thanks.
Set viewship to 2 or higher (line 63) to have the camera follow one of the AI ships.
Kyhoshi
18
Years of Service
User Offline
Joined: 21st Jun 2006
Location: Somewhere over the rainbow.
Posted: 30th Dec 2006 08:03
you never stop amasing me, lower logic. i love it!

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Gaius Baltar
18
Years of Service
User Offline
Joined: 14th Nov 2006
Location:
Posted: 31st Dec 2006 03:02
I'm actually making a full BSG game based on the new Series, and this is VERY impressive. I am unable to tackle AI due to the fact that I am using the Newton DLL.
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 10th Jan 2007 06:25
ARGHH!! It took them a week to aprove my DBP order, and I REALLY want to try this!!!

"There will always be evil, for, without evil, the good shall lose their virtue."
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 15th Jan 2007 21:02 Edited at: 30th Jan 2007 23:12
Finally got DPB- THIS IS INSANELY AWESOME!!! Have you thought about writing a tutorial, or at least explaining the principles behind the AI? It would be much appreciated.

"There will always be evil, for, without evil, the good shall lose their virtue."
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 16th Jan 2007 18:26
Yes A.I tutorial would be awesome!

I have no soul.. I nobody.. I have no heart.. I have felt in the darkness.. Im the darkness.. Whatever..
megatroid
17
Years of Service
User Offline
Joined: 30th Jan 2007
Location:
Posted: 30th Jan 2007 20:12
[b]
hey...lower user
i believe your sim would be great...but copy and paste dont cut it....
literaly....cant seem to cut and paste without eveything being crammed in one big heap of letters and symbols. the words and sentences wont seperate when pasted to any document (notepad / wordpad...etc etc)
(cr/lf) ?????
megatroid
17
Years of Service
User Offline
Joined: 30th Jan 2007
Location:
Posted: 30th Jan 2007 20:13
sorry on last post lower logic not user is what i meant....lol
DarkFact
18
Years of Service
User Offline
Joined: 18th Feb 2006
Location:
Posted: 5th Feb 2007 03:19
Why don't you just paste it directly into the DBpro IDE?

Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 5th Feb 2007 03:22
Megatroid confuses me... I had no problems at all...

"There will always be evil, for, without evil, the good shall lose their virtue."
DarkFact
18
Years of Service
User Offline
Joined: 18th Feb 2006
Location:
Posted: 5th Feb 2007 03:23
me neither. worked great

Login to post a reply

Server time is: 2024-11-23 00:33:11
Your offset time is: 2024-11-23 00:33:11