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.

Program Announcements / DBTest.exe - The test that turned into a game

Author
Message
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 24th Aug 2005 23:14
Hi all,

I thought I'd share my first dabblings with DarkSDK with everyone. It's a rather retro experience, but I hope you enjoy it

I've made the source code available too, it's all in C++ and will require DarkSDK as well as Visual Studio 6 or 7 to complile it.



http://www.balakov.co.uk/DBTest/

Enjoy.
Kaiyodo.
Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 25th Aug 2005 07:50
That is one hell of a cool game! I'd say keep developing it, but at the same time I like how it is.
Tinkergirl
20
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 25th Aug 2005 08:17
I can't help it - I've just got to say that's really cool. Quirky and retro!
Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 25th Aug 2005 09:09 Edited at: 25th Aug 2005 09:15
If being a robber was this fun and easy, I think I'd give up my current job. Are you planning to make more maps?

[edit]

Just noticed on your site it mentioned random generated maps. How about a command to switch to a new map?
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 25th Aug 2005 11:38
Torrey, if you've got random maps turned on then you should get a new map every time you run it. I had a bit of a plan to allow you to return to the frontend and select a new map, but that ended up being a bit awkward so I left it as is

Kaiyodo.
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 25th Aug 2005 12:35
Cool game. First thing I've seen from DarkSDK. Only problem I noticed was the camera was a bit jumpy.

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 25th Aug 2005 20:35
If you keep developing it don't lose it's current graphical style...because it rocks

"We make the worst games in the universe."

Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 26th Aug 2005 08:41
Here's two screen shots.

Catalyst
20
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 26th Aug 2005 21:07 Edited at: 26th Aug 2005 21:17
Okay, this is probably my favourite game I've seen made in Dark Basic...well, DarkSDK. A few suggestions though:

Collision between cars
Police cars need to actually collide to catch you
Faster police cars when they're chasing you
random traffic
handbrake turns
some sort of stylized effect when using turbo...make turbo faster too.

Again, these are just suggestions in case you're still going to develop more on the game. I hope you do, it's a project that is really worth doing more with.

EDIT: Other thing I forgot, the police cars seem to have some issue finding me...they spin around or something.
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 26th Aug 2005 22:41
Suggestions noted, thanks Catalyst

I had some of these in mind myself, but there's always the danger of making it too easy. Having the police cars have to collide with you requires the AI to be pretty good at driving otherwise you can trivially avoid them. At the moment the AI's not good enough for that, they're not really aware that they're driving a very slidy car. That's also part of the reason they don't put their foot down more when chasing you

I'd like to put in random traffic if I have the time and inclination at some point, that's a nice idea.

Oh, and the police cars spinning around, they do that when they've overshot their destination. There's code in there to minimise that, but I've seen it happen enough to think it's not working as well as it could.

Quick message to Torrey, you've doubled my hiscore! I need to add more police obviously

Glad you're having fun with it.

Kaiyodo.
Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 27th Aug 2005 19:30
To be honest once you get 5-6 police cars going at once the game almost gets too difficult, that's usually when I get caught.
Catalyst
20
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 27th Aug 2005 21:29
@Torrey
Well, that's why I say they should have to collide with you...it's strange to get busted just because they're on the same square as you.

@Kaiyodo
Actually, I don't think it would be a problem that they're driving a slidy car...basically, they'd be faster than you(Not much, but noticeably) and they could head straight towards you, but you'd have to use the slidy factor of the car to avoid them, i.e. you'd do a quick turn and they'd miss you and overshoot, then have to spin around and try getting you. Maybe even make them more slidy than your car is.

Also with them spinning around...I've seen them do that when it was a clear line of sight between them and me. Something with your pathfinding? If I remember correctly, the A* routine is very tile based, ja? So, the police only know which tile to head for and if they're on the same tile as you, you're caught? That's what it's looking like in here.

A bit of a suggestion. Cast a ray from police to player, see if it's colliding with any buildings. If it's not colliding, skip A* search. Have two vectors locked to the police car and offset to the sides, then one vector for player car. It can check the distance of the two vectors to the player vector, see which is the shortest and turn a little in that direction until they're both about equal. That was something I had done in a pathfinding routine, worked really well. If you get to the point of adding random traffic and collision between all the cars, I can post more of my pathfinding rountine. I think it would be a good compliment to A*, use A* to figure out which tile it needs to get to, but this other method to avoid hitting other cars.

And then, you can use Tokomak to make the other cars go spinning around when you hit them and then, you could.......okay, that's it. Next game I make is going to be a car game. Too bad I'm all wrapped up in my fighting game right now.
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 27th Aug 2005 22:18
Catalyst,

The police path finding is tile based, you're correct there. Each time the player changes square the police re-calculate their path to the player's current square. They actually catch you when they reach their final waypoint, so it is possible to avoid them even when you're in the same square (as long as they haven't quite reached the centre yet), but it's more luck than anything else.

Getting the police to abandon their A* route if they don't have line-of-sight might be interesting. The police cars already have the ability to drive towards any point, at the moment they're just told to goto the centre of squares by the A* generated path. I spent a fair amount of time getting them to try and drive smoothly between their waypoints (they even start turning towards the next waypoint before they get to their current one).

I choose a different method to get the police to drive towards their waypoint though. I use an arctan to calculate the angle between the police car and his destination, then I compare that to the police car's current rotation and use the difference in angle to work out how much he needs to steer in that direction. It ends up with the same results as your method in the end though.

I was actually looking at physics today, but with ODE rather than Tokomak as I'm slightly more familiar with it. I wasn't planning on putting any into DBTest, but you never know

Kaiyodo.
Catalyst
20
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 28th Aug 2005 06:19
You know, that tile centre bit gave me an idea...bit of a cheat in your game. If a police car is coming right at me, I can wait at the edge of a tile until they get onto the same tile, then pass them up onto the tile they just came off of.

But playing with it more, they really do end up spinning around a lot even when in line of sight. Your arctan method...that's basically doing a dot product calculation to get that, ja? I've been trying to make proper sense of how to apply that calculation, it had been confusing me since the only equation I saw for it involved already having the angle. Finally saw the way of doing it with just the vectors. Anyway, that's a whole other story, but good job on that. Sounds like it could probably be pretty easily adapted to just make the waypoint be the player car.

What is ODE? I haven't played with physics in a game yet, but the only two I knew of that worked well with Dark Basic were Newton and Tokomak.

You're making me want to do a car game the more I play with this one...think it's time to start doing some research. Don't worry, it won't be a clone of yours.
Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 28th Aug 2005 07:55 Edited at: 28th Aug 2005 07:56
ODE is gaining popularity lately. In fact that physics engine is being used in FPSC. Before that was announced I was trying to turn that engine into a plugin for DBP. By checking out (www.ode.org) you'll see it's being used in lots of games now.
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 28th Aug 2005 10:40
enjoyed this lots nice break into darksdk for sure XD

Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 28th Aug 2005 17:53
I've just uploaded a new version to my website. It's got some of Catalyst's feature requests in

The turbo is a bit faster.

There's a handbrake (Left or right SHIFT key).

Police are now able to use both the turbo and the handbrake.

Added 'Arcade' mode which makes the police cars faster and more aggressive.

Added 3 more car models to choose from.

The 'Arcade' Mode is where all of the AI work has been done. I didn't want to completely remove the old way the police caught you in case the new way was a complete disaster, so I added it as a new game mode In arcade mode the police drive straight at you when they have line of sight and have to collide with you to arrest you. There's still no real car-to-car collision (they drive straight through you) but that's slightly harder

I know why the police cars sometimes have trouble pathfinding and end up spinning around now, it seems to be a bug Because the A* is recalculated every time the player car moves a square, the police can end up with a waypoint behind them. Say they're just at the edge of a square and the route is recalculated, they now have a waypoint behind them in the centre of the square they're driving out of. They should flag these as 'reached' immediately, but as is all too often the case, what I think the code I've written does, and what it actually does are not the same thing

http://www.balakov.co.uk/DBTest

Kaiyodo
Catalyst
20
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 28th Aug 2005 21:29
Looking great Kaiyodo!

The new collision method is working great, it's really good when you have lots of police cars and you actually have to try driving between them all.

Handbrake works great,turbo is great, new cars are really great!

I'm noticing the cars still spinning a lot when there's a wall between the player and police, but the line of sight attack is making it so at least they don't do that when they're in plain sight.

All in all it's...well, great!

Login to post a reply

Server time is: 2024-06-29 04:48:21
Your offset time is: 2024-06-29 04:48:21