PROJECT: Sectors -- the evolution of a game

Pages : [1] 2

Teric
05-28-2002, 08:01 AM
Hi ho! After a long hiatus, work has died down (just a little bit!!), which has given me some time to do a bit more game programming.

This is my project called 'Sectors'. In its completed state, it will be a multi-player space action game with some strategy elements.

At this point, the game allows you to fly around a single sector (no stargates for sector-to-sector travel yet). I tried to make the flying animation as smooth as possible, with a scrolling background as you fly. Please observe that as you fly, the background will scroll dynamically with the speed that you travel.

I've also put in a number of AI controlled ships that fly around randomly. On my machine, I've had 800 of these AI ships flying around the sector without any slowdown!

Graphics were created by me using Blender 2.23.

Let me know what you think!

Teric
05-28-2002, 08:14 AM
Sorry, I forgot to tell you what the controls are for the game.

Use the arrow keys:

Up: Thrust
Left: Turn Counter-Clockwise
Right: Turn Clockwise
Down: Brake

matticus_99
05-28-2002, 10:00 AM
Very nice, the movement of ships was very realistic. :D

John
05-28-2002, 11:49 AM
Pretty cool, I like the Air Brakes :D

Orbity

Squirm
05-28-2002, 12:43 PM
Closing the form should end the game. At the moment, the form keeps coming back. :-\

Teric
05-28-2002, 01:12 PM
Oops, you're right--let me fix that.

For now, you can press ESC to exit the game.

Pookie
05-28-2002, 07:06 PM
I would of thought the ship would scroll in the opposite way as to how it does now, as in, if the ship is flying up, it should move towards the bottom of the screen, so people can see more in front of the ship instead of seeing less...

Teric
05-29-2002, 07:40 AM
That is an interesting idea, Pookie... and it does make sense.

However, I want to keep the ship as close to the center of the screen as possible. I think I'll shrink down the scroll rectangle (if your ship tries to fly out of this rectangle, the background scrolls). Currently, this rectangle is 1/3 of the height and 1/3 of the width of the screen. I'll take it down to 1/5. That way, the ship will stay closer to the center of the screen (because the background will scroll sooner), and the player will be able to see more out in front of the ship.

Please note, I'm going to have a radar at the upper right of the screen, which will show the location of enemy ships and other objects in relation to the player's ship.

andreww
05-29-2002, 08:11 AM
a few ideas
i dont know if you've played elite
its basically a very old 3D space game where u can be a pirate or trader, bountry hunter etc

a 2D version of that would be nice, with good graphics tho

your graphics are pretty good, but for a better effect i reakon having everything smaller would look better

also (i saw this in another game)
when you add the guns, if u have bullets flying out you could make the bullets only travel a short distance, so dog fights are a must

and the game is less lagy as there are less bullets on screen, whilst making it look like the ship is doing rapid fire

Teric
05-29-2002, 09:14 AM
Andreww--

Thanks for your comments. Yes, I did play Elite, once or twice, waaaaaaaayyyyy back when.... (whew, that was a LONG time ago!) I don't want to make this a big strategy game; I want to keep it mostly action with a few strategy elements.

On the other hand, yes, I do intend to keep shots short range. Shot speed, power, spread, etc. will depend on what upgrades you can afford to make to your weapons...

wild wolf
05-30-2002, 03:37 AM
the air breaks is a cool idea but i have a suggestion, when u break slow down the ship and if it comes to a halt (0) then the values can move negative and thus it will give a reverse effect, in that way when an enemy is come head long on you from the front and you are moving back you can fight as well, get what i mean?

Teric
05-30-2002, 08:15 AM
I could do that, wolf. However, couldn't you do the same thing by simply thrusting in one direction, then let go of thrust, turn around, and coast backwards? There's no friction/drag in space, so you won't slow down until you thrust in a different direction.

Teric
05-30-2002, 11:48 AM
I've updated my Sectors project.

New Features:
1. The game will now exit when you click the close button on the upper right corner of the game window.
2. The 'scroll rectangle' has been made smaller (the rectangle around your ship that determines which way the background will scroll).
3. Basic particle engine. So far, I've only used this engine to create exhaust gases coming out of the back of the main ship. However, this particle engine could be used to create explosions, floating debris, space dust, even projectiles. We'll see where it goes...

Enjoy!

John
05-30-2002, 12:55 PM
Coming along nicely Teric. Although gaming is not my forté, I do see something a bit odd. When the user holds down the up arrow the gas particles stand still. Is this what is supposed to happen or have you not had a chance to make it look like it is constantly coming out, or is this by design?

Will this have a full screen mode later on?

Good Work,
Orbity

Teric
05-30-2002, 02:27 PM
Hm... you're right, Orbity. I think I can solve that by randomly varying the sprite used by the gas particles.

I'll use two different sequences of sprites for gas particle animation; when a gas particle is created, I'll randomly assign one animation sequence to it. I think that will solve this problem.

Thanks for the suggestion!

Teric
05-31-2002, 03:30 PM
Another update:

1. Took Orbity's suggestion and varied the exhaust gas animation. Now it doesn't look so static.
2. Fixed a problem where the ship sprite would 'jump' a bit when it flew across the edge of a sector and wrapped around to the other side.
3. Created a radar. You can now see a grid in the upper right corner of the view screen, showing small blue dots for enemies, and a large yellow dot for your ship.
4. Hit space bar to fire the basic dual-shot weapon. (In the final game, better weapons can be installed when you can afford to upgrade them....)

Enjoy!

Genzo
06-02-2002, 02:59 AM
I have just came across this message board only a few days ago, and this post caught my attention.

I am just learning to program games in VB which looks like it can be fun and the first game that i thought i would make would be something like Sectors.

I have had alook at the code but can only understand some of the things you have done which has helped me see what im getting into. I think this game can be made into a great game over time.

So keep going because you are doing a great job.
Looking forward to the nexted update.

andreww
06-03-2002, 05:50 AM
i want to hunt aliens already

Teric
06-03-2002, 07:45 AM
Genzo: Thanks for the compliments. Good luck on your game programming!

Andreww: All in good time, my dear... all in good time.

Squirm
06-03-2002, 08:40 AM
View area could be bigger, and I agree that the ship should move towards the bottom so you can see more ahead instead of less.

:)

Teric
06-03-2002, 02:41 PM
Update!

1. I've split out projectiles from particles, so that I can actually run collision detection on them. Projectiles will now detect whether or not they have hit an enemy.
2. New particles! Using the same particle engine, I have created explosions with flame and flying debris.

Enjoy!

hotrodx
06-03-2002, 04:58 PM
Hey Teric,

Reminds me of Star Control. Love it.

I know you're planning an action-oriented kind of game, but Starflight had this kind of combat. Starflight is actually an RPG, so with little modification this can be turned an RPG.

The engine is very nice. Good work as always.

Teric
06-03-2002, 06:50 PM
Actually, I am taking quite a bit of inspiration from Star Control II, mixed in with the action from the old Arcade game Sinistar.

Thanks for noticing!

Squirm
06-03-2002, 06:57 PM
Wow, those explosions are amazing and yet so simple using the particle model. Sweet.

Teric
06-05-2002, 08:33 PM
Small update:

1. I've changed the explosion debris sprites to 3D rendered models. Now the debris spins and reflects light more realistically.

2. Enemy ships now visibly take damage. If a ship is hit but not destroyed, small bits of metal will be blasted off.

Enjoy...

EDIT: Oops, enemy ships were set to die on one hit. I increased their hull strength a bit...

chris00
06-05-2002, 08:41 PM
Great Game
I just tryed the new download and I like the explosion debris effects.

Keep up the great work !!! :D :) :D

Gamer X
06-11-2002, 10:32 AM
Wow, super-cool! Reminds me a bit of asteroids. A couple ideas:

1. Star drift. Even when sitting still the stars move a bit.
2. Direction indicator. On the mini-map, some irregularity on your yellow blip to show you what direction you're facing.

Not necessary things, but they'd be neat.

A little question, not about the game: What are the .cls files? I've seen those other places too. What are they, and what advantage to they have in their use? Thanks.

Really great game!

-Gamer X (http://gamerx-creations.cjb.net)

Stoicus
06-11-2002, 12:13 PM
The .cls files are for the Classes he's created for the game.

Question about the game, what do you do once you've cleared all the enemy ships? I'm sure you're still working out level progression, difficulty settings, etc, but for now, how about just an in-game command to refresh the field with new bad guys to toast. :)

P.S.-Great game, regardless.

Teric
06-11-2002, 12:48 PM
Thanks for the great feedback. It's very encouraging to hear that people like the game.

-Star Drift: Sounds like a good idea. I'll chalk that one up.
-Direction Indicator: I don't think that's necessary, because then people would be inclined to fly completely by radar; I want to avoid that if I can.
-Reset Baddies: Won't be necessary in the final version, because either you will control the sector and move on to the next, or more baddies will warp in via stargate.

Here are the current things I'm currently working on:
1. Shields for the player's ship
2. Enemy AI--simple for now; if they're within a certain distance of you, they'll close in and attack
3. Enemies firing shots at you
4. Collision detection between ships

Teric
06-11-2002, 03:30 PM
Update!

1. Your ship now has shields and hull strength. Shields will gradually recharge over time, but hull damage will not.

2. Enemy ships now track you and hunt you down if you come within range of them. They only have one shot at a time, but their shots are more powerful than yours. Watch out!

3. You can be destroyed. If you die, the game is over.

4. The game keeps score for you.

5. Labels in the upper right of the game window will display current shields, hull strength, and score. Sorry about the flicker on these labels--I'll fix that in the next update.

Enjoy!

Teric
06-11-2002, 03:32 PM
Sorry, forgot to attach the game. *bonk self*

John
06-11-2002, 04:19 PM
Coming along very nicely I must say.

Orbity

wild wolf
06-12-2002, 03:34 AM
perfect piece of work man!!! i love the explosions and the way the enemy follows you, really cool, keep it alive man!!

asrar

Teric
06-17-2002, 04:09 PM
Update!

1. I've implemented a text engine. It's pretty blocky right now, but I can go through and change the font size pretty easily. No more flickering text!

2. Ships now collide with each other realistically. If you bump into an enemy ship, the physics engine will calculate where you hit it, and transfer the relative velocities created by the impact (much like what happens when billiards balls hit each other). Currently, ships on the same team do not detect collisions with each other.

3. When ships (yours or enemy's) are hit with projectiles, the same physics engine takes effect, but the velocity transfer is much smaller because the mass of a projectile is much smaller. (But if an enemy were to hit you with a more massive projectile, the effect would be greater).

Enjoy! Please post your maximum scores here. Let's see who can get the highest score!

LordHelmut
06-17-2002, 04:27 PM
All the earlier ones were great, they didnt lag at all. I was thinking, "Wow, I underestimated bitblt" but then on this last one it seems rather laggy. I really like all your stuff up until this one. I do agree the view screen needs to be bigger but at the same time keep the around the same FPS. Keep up the work :) its looking good, you may wanna learn DirectX and do it fullscreen :)

Teric
06-17-2002, 04:45 PM
Aw, crumb... that means I'm hitting the framerate wall--my logic processing is taking longer than the time between frames.

*sigh* Well, I guess I need to go back through and do some optimization.

Is anybody willing to take my code and figure out where the most cycles are being taken up? That would help, because then I would know where to focus my optimization efforts.

Squirm
06-17-2002, 05:02 PM
Well, I did a short test:

Seconds used by process in a game lasting about 1 minute

Handlekeys = 0.183750000011059
Move = 1.55968750000466
Particles = 0.172812500022701
Collisions = 16.2284375000309
SectorView = 2.31250000069849E-02
SectorDisp = 8.9756250000064
RadarDisp = 1.37093749995984
Text = 0.639687499962747

Looks like the collision algorithm is really sapping time. You need a way of skipping duplicate tests.

BillSoo
06-17-2002, 10:01 PM
On this line:

If mCol.Item(i).ObjType = OBJ_TYPE_PROJECTILE Or OBJ_TYPE_SHIP Or OBJ_TYPE_PLAYERSHIP Then

The various flags are OR'ed together before testing against objtype.

So 3 or 2 or 1 = 3

Essentially, the test is only true if the objtype is a projectile.

LordHelmut
06-17-2002, 10:12 PM
Originally posted by Squirm
Well, I did a short test:

Seconds used by process in a game lasting about 1 minute

Handlekeys = 0.183750000011059
Move = 1.55968750000466
Particles = 0.172812500022701
Collisions = 16.2284375000309
SectorView = 2.31250000069849E-02
SectorDisp = 8.9756250000064
RadarDisp = 1.37093749995984
Text = 0.639687499962747

Looks like the collision algorithm is really sapping time. You need a way of skipping duplicate tests.

0.0 how the hell did you do that?

BillSoo
06-17-2002, 10:36 PM
I'm guessing he used the Visual Studio profiler....

Incidentally, I find that if I fly backwards, the enemy are dead meat.

They line themselves up on your back trail and since they are rushing towards your shots and you are running away from theirs, you can easily blow them up.

I played a game a long time ago, "Rules of Engagement", which had a similar flaw. With it, you could easily destroy the heaviest battleship with only a scout.

Stoicus
06-17-2002, 11:33 PM
Incidentally, I find that if I fly backwards, the enemy are dead meat.

They line themselves up on your back trail and since they are rushing towards your shots and you are running away from theirs, you can easily blow them up.

hehe...I did the same thing until I got bored.

Squirm
06-18-2002, 03:25 AM
LordHelmut:

I did it by making 7 doubles, and then using the Timer function to increment them. Something like this:

'Detect projectile collisions
d = Timer
gObjects.DetectCollisions
dTimeCollisions = dTimeCollisions + (Timer - d)

Bill:

You're right that the flags are being combined, and not tested separately, however when playing the game I notice that all collisions are affecting me, not just projectiles.

:-\

Gamer X
06-18-2002, 06:04 AM
Originally posted by BillSoo
I'm guessing he used the Visual Studio profiler....


Where do I get that? I have VisualStudio 6.


Arigato,
Gamer X

hotrodx
06-18-2002, 07:21 AM
To Squirm:

Hey, nice technique! Never thought of that...


To Billsoo & Stoicus: re Gameplay flaw

You guys certainly have a point. However, it's too early to tell. Teric has just implemented one enemy type (agile but low speed). Maybe he'll add enemy types that are fast but turns slower... or enemies that have it's own shield... or asteroids(fixed or drifting) so he cannot always use that "drift, turn & fire" cheat. So many possibilities-- I'm anxious with what he does next.


To LordHelmut: re Slowdown

What's your PCs config? Maybe that can help Teric a bit. Mine's a 1Ghz Duron, 32mb TNT2. There's a slight drop of framerate when you fire and when there's a bunch of enemies on screen that fires back, but it's not laggy, really. I mean I've played 16bit consoles to death, so I kinda know when the drop is unbearable or not. Heck, Gradius 3 had a lot of slowdowns, yet it's many's favorite. Anyway, Teric'll think of a way to fit every routine within 33 milliseconds. Maybe limit shots but make them faster so that they appear numerous?


To Teric:

Problems aside, I think it's a nice piece of work. The code has some sense of "poetry" in it. It is complex-- yet orderly-- at the same time, and I find it envious. I am also surprised with what you can do with GDI. I'm a DirectX preacher-- but seeing your work without any directdraw routines surprised me a lot! And that the guys have come to agreement that the drop of framerate is caused by collision check-- not because of the graphics-- makes it more awesome. Keep it up!

Teric
06-18-2002, 08:24 AM
Wow, I didn't expect such a wealth of responses and information! Thanks, you guys!

I really appreciate the compliments. Honestly, if I wasn't coding this at work, I would be using DirectX no questions asked. However, since there are some very bureaucratic regulations in place here, I can't even save .mp3 files on the computer's hard drive without the gestapo coming to drag me away. *sigh* Thus, DirectX on this game is not possible at this point.

On the other hand, thanks for figuring out where I need to optimize! You guys are awesome!

Squirm
06-18-2002, 09:31 AM
I removed the framerate limit and it made no noticeable difference. :-\
Slight bug - when I die, the enemies still shoot at me (or where I was) and if I try to thrust, I can see the exhaust trails as if they were coming from my ship.

:)

Teric
06-18-2002, 01:27 PM
Squirm-

Yep, I'm aware of that bug, I'll take care of it.

All-

I tried something that may have actually slowed things down instead of speeding thing up. Previous to the latest update, I kept collections of all objects separate (i.e. a collection for projectiles, a collection for enemy ships, etc).

In this last update, I combined all collideable objects into a single collection (called ObjectList). I can now loop through this collection using a single Object variable to refer to each object.

I'm wondering, however, if that has slowed things down, since the Object variable is a lot like a Variant in that it's a memory hog and has a lot of inherent type casting associated with it. Should I split my objects back out into their individual collections?

BillSoo
06-18-2002, 01:41 PM
Yes. Another problem is that each of your projectiles has to check if it collides with another one of your projectiles...a clear impossibility. Putting them in their own collection would allow them to ignore each other.

Teric
06-18-2002, 01:48 PM
*sigh* Ok... back to the drawing board...

LordHelmut
06-18-2002, 01:58 PM
Hotrod, Mines a 20gig, 500 mhz, 384 ram. Even though its nothing great any little ship shooter game should run fine on it.

BillSoo
06-18-2002, 02:56 PM
I forgot to mention that on my system, when I point my ship down and to the right, the magenta background becomes visible. It might just be my videocard though because I had some other problems with it....

chris00
06-18-2002, 03:07 PM
Hi

I tried the new version of your game. It is great , besides some off the things mentioned, as I said before keep up the good work.

Can't wait for the update.

P.S : I am glad its your program and not my computer that is slow (eventhough my computer is slow). But I would go back to all objects separate.

hotrodx
06-19-2002, 05:05 AM
To LordHelmut:

I guess you're right. A 500Mhz requirement for a 2D game is indeed excessive.

Too bad about the Gestapo running around Teric's office -- he can't do it with DirectX... but then again, the problem really was the collision detection routine... not GDI.

hotrodx
06-19-2002, 05:50 AM
Scene: Teric's office. Teric is busy adding new features to his new game, Sectors. Every now and then he looks at his left-- then at his right-- to check if someone's looking.

However... he was caught by surprise when the IT Gestapo arrived to make a random inspection...

Gestapo: Move over, employee. Let me see your workstation.

Teric: Y-yes, sir.

Gestapo: (Looking over the directories, making file searches) Hmm... okay no MP3s saved. None of those vulgar *.mpg videos. No pinball... good... no minesweeper or that blasted solitaire... very good...

Teric: Uh-huh...

Gestapo: Did you hear about the guy I fired last week because he had a Britney Spears screensaver in it?

Teric: Uh-huh...

Gestapo: Look. No DirectX installed. You can't play any games without it. Har-har.

Teric: (Whispers to himself) If you only knew...

Gestapo: You were saying sumthin', son?

Teric: No, no, no. Nothing, sir.

Gestapo: Now let me check at your VB files.

Teric: Gulp!

Gestapo: (Looking at the Visual Basic program directories, but not running them). Inventory... ... Employees... hmmm, what's this... Sectors?

Teric: *I'm in trouble*

Gestapo: Sectors, sectors, sectors, hmm... AHA!... you're making a HARD DRIVE UTILITY. Nice work, employee. Now that's initiative! Keep up the good work! Give me a copy when you're finished, okay?

Teric: (Relieved) Wooh. Okay, sir.

Gestapo: (As leaving) Okay, employee, don't let me catch with ships flying on your screen!

END OF STORY

Teric
06-19-2002, 07:53 AM
Hotrodx:

HAHAHAHA!!!! That's AWESOME!! Thanks for making me laugh in my office this morning. :D

ChiefRedBull
06-19-2002, 08:41 AM
LOL, nice one. :D

Mikecrosoft
06-19-2002, 02:45 PM
Perdon por escribirte en español pero asi podria decirte algunas cosas que no se como decir:

Tu juego esta muy bien hecho, y es muy original.

Tal vez debas de usar TextoOut o DrawText para dibujar el texto, de esa manera evitarias el parpadeo.

Cuando sea grande quiero ser como tu Teric. !!! :)

Mikecrosoft
06-20-2002, 11:19 AM
I'm playing your game, and I see a little thing, when you fly to any direction, the AIShips follow you, but always from the back of your direction, then I can turn the ship to destroy all ships without change the direction of movement, I can destroy all ships because this ships are always follow me from the back and I can only shot and shot and shot without turn the ship and destroy all. If you can do that the ships follow the Playership of any direction will be better !


Sorry my english !!


:)

Teric
06-22-2002, 08:16 AM
Yes, I am aware of that problem. I am working on putting a few things into the game that will make tactics like the "backward scoot & shoot" a lot more difficult.

Teric
06-22-2002, 08:20 AM
Mikecrosoft:

Gracias por escribirme en espanol.

Si, pense usar 'TextOut', pero quise dibujar texto con sprites, para ver si pude hacerlo.

!Muchas gracias por los comentos positivos!

Genzo
06-24-2002, 03:41 AM
Hey Teric have you managed to speed it up.

Ideas
Have you thought to make your game like this online game called
Cosmic Rift which i think is cool when you can get it to work.

Learning
I have been looking at your code and altering things and i have started to catch on how you have done this.

At the moment i have added a GUI with fuel, afterburner Fuel, Shield, Current Speed, Thrust Bars. I have got the chat and some other windows in place.

I manage to insert some code to allow you to have afterburners,
i have added a weapon selection system so that you can select from different weapons but at the moment i have only got three.


Thanks because people like you give people like me a chance to learn from you cool work.

And keep up the good work.

Dont let this thread die.

Squirm
06-24-2002, 05:33 AM
If this thread is anything like the one for Teric's last game (the RPG), it will stay alive for quite some time! Something tells me this one will be even better!

:D Check it out http://www.visualbasicforum.com/showthread.php?s=&threadid=13573

Iceplug
06-24-2002, 07:08 AM
I guess that Teric put the RPG to side (work perhaps)... it would still be active today. Too bad - no level ups either.

Teric
06-26-2002, 11:59 AM
Thanks for the great feedback, guys!

Yes, unfortunately, the RPG thread got put on the back burner because of work.

Genzo-

Could you attach the modifications you made? I'd like to see them!

Genzo
06-27-2002, 02:59 AM
I have attached the modifications.

It is in a bit of a mess so sorry. But i was not going to show anyone so i thought what was the point at this moment anyway.

ChiefRedBull
06-27-2002, 05:13 AM
I love the new graphics and weapons. However, I couldn't get the afterburner to work.... i pushed the key, and nothing happened, so I changed the keycode it was looking for from 9 to 119 (w), and still nothing happened...

Otherwise, excellent.

Genzo
06-27-2002, 08:15 AM
Sorry i forgot to put the keys.

use the arrows.
The Tab key enables the afterburner. Then when you push the up arrow key you will go alot faster, which you can tell by the fuel bar at the top go's down.

Q changes to a different weapon.
Space bar fire that weapon.

There are only Three weapons at the moment.

Thanks for the comments.

Teric
06-27-2002, 09:02 AM
Holy Cow, Genzo! That looks great!! I love the GUI you put together.

I also like the new weapon graphics. I want to make weapons their own objects, so I'll probably change some things around that you did, but I really like the changes you've made.

Do you mind if I keep what you've done, and modify it a bit?

Genzo
06-27-2002, 12:16 PM
Of course you can.

Teric
07-03-2002, 05:52 AM
Currently working on putting asteroids into the game, and optimizing collision detection. I hope to have an update posted soon...

ChiefRedBull
07-03-2002, 06:14 AM
I'm looking forward to it! :D

Teric
07-03-2002, 04:15 PM
Update!

1. I improved the collision detection algorithm a bit, but I still have a lot of work to do (sigh...) The game does run a bit faster now, but it still can't take a large number of objects flying in the sector at a time.

2. Asteroids now fly randomly through the sector. You can destroy them, but they can take a lot of damage before crumbling into space dust.

3. Collisions between asteroids, enemy ships, and your ship are all implemented. You don't take damage from these collisions (yet), but you can get bounced around pretty hard by those massive asteroids.

4. Haven't put in any of Genzo's graphics yet, but I'm still going to use them!

Please let me know what you think. Also--I would LOVE some help optimizing collision detection! :(

Enjoy!

Epo
07-03-2002, 05:34 PM
Really like the asteroids, but (just a suggestion) if an asteroid crashes in to you when you are not moving, your ship doesn't go anywhere and the asteroid changes direction(my guess is that you're just reversing velocities...that's just a guess). My suggestion is to keep the asteroids going in the same direction (regardless of collission) and have the object that collides with the asteroid bounce off based on object's speed, asteroid speed, and angle of collision. I really don't know how hard that would be, or if you just don't want to :) but there it is :)

hotrodx
07-04-2002, 01:17 AM
Re: New update

The game ROCKS! (pun intended)

Imagine my laughter as swarm of enemies follow my ship, then out of nowhere comes an asteroid, hitting them like pins to a bowling ball. Kinda reminds me of Empire Strikes Back. Can't wait to see asteroid damage (to you and enemies) implemented.

I love the asteroids. Sometimes I intentionally run into a bunch of asteroids as enemies follow, and see them get hit (although they don't explode). It also changes your strategy a bit, as you got to check the radar every now and then if an asteroid is nearby.

I also noticed that your shots aren't left behind as before, So you can't do the "drift, turn and fire" cheat anymore. This time you got to face your enemies head on. Good job.

A suggestion: Maybe you can change the delay between frames for the asteroids for every instances. Some turn faster, some slower. It doesn't add anything to the gameplay, though.


Re: Genzo using Teric's Sectors engine

Wow. Kinda like Half-Life to Quake II! Soon, Teric's gonna issue licenses for it!

Genzo
07-04-2002, 03:14 AM
I have justed downloaded the latest version and will reply later.

Update
I have added a class for weapons.
You can have duel weapon that shoot two bullets or just one at a time.

Added a bit more sound.

but at the moment im just trying to improve the GUI (Graphical User Interface) of the game.

I cant wait to try you newest version.

Teric have you thought of making this like an online space game?

Teric
07-04-2002, 09:09 AM
Epo--

Collision between objects in space is based on velocity, direction, and object mass. I am not simply reversing velocities, but I am transferring velocities, depending on the speed/direction/mass of each object in the collision. The more massive an object is, the less effect there will be when some other object hits it.

If you're seeing too dramatic an effect when asteroids are hit, then perhaps I need to increase the asteroid's mass.

Hotrodx--different animation velocities on the asteroids, hm? I think I can do that. Let me take a look...

Genzo--Yes, I have thought about making this an online game. For now, I want to finish the one-player aspect of it (but leaving it wide open to add more players in the future).

I'm afraid, however, that this game may not be up to snuff if I keep it in VB (OUCH, it really hurt to say that!!). Unless I find a way to significantly optimize collision detection, I'm going to have to switch everything over to C++. :(

"Any help would be hot..." --Jar Jar Binks

ChiefRedBull
07-04-2002, 09:12 AM
It is still looking amazing teric, but I hate to say it's slowed down a little with the addition of asteroids. Only a teeny bit, but it is noticeable...

Teric
07-04-2002, 09:33 AM
*sigh*

Yeah, I know. I've been looking at articles & tutorials on collision detection to figure out a way to optimize it. I've implemented some of the things I've learned, but it doesn't seem to make a very large difference.

I used to detect collisions using bounding circles and seeing if radii intersect. Now I'm using bounding boxes and seeing if they overlap. I still don't see a significant improvement, though. I'm afraid I'm going to have to get into some detailed mathematical optimization in order to get this right.

Teric
07-05-2002, 12:57 PM
I hope I've discovered the problem with collision detection!

It's not my algorithm--in fact, the algorithm is pretty fast already. I went through and did some low-level timing (in milliseconds) of the various parts of my collision detection routine. Please note that GetTickCount() is not very accurate once you get below 100 ms granularity.

Here is what I discovered:

Collide Time: 45231 ms
Collide Check Time: 0 ms
Bound Box Time: 0 ms
Take Hit Time: 10 ms
Total Game Time: 92443 ms

Meaning, out of the 92 seconds that I played the game, a whopping 45 of those seconds were dedicated to the collision detection routine.

HOWEVER! Checking to see if a collision has occurred (Collide Check Time) took no time at all. Computing bounding box overlap (Bound Box Time) also took no time. Registering hits, damage, and velocity transfer (Take Hit Time) took very few CPU cycles.

SO... where was all the time taken up?!

I'm using VB Collection Objects to manage all of my game objects. Could it possibly be that access time on VB Collection objects is inherently slow, cumbersome, and full of unnecessary overhead? If someone knows the answer to this question, I would love to know for sure before I start ripping apart my program to use linked lists instead of collection objects.


For i = 1 to 100
Bonk_Self()
Next i

BillSoo
07-05-2002, 01:02 PM
First, if you have Win98, the timeGetTime API is accurate to 1ms resolution. For some reason, it has worse resolution on NT....see the Contest thread in Random thoughts....

Second, I *think* the collection object is slower for access than arrays but faster for insertion....I'll take a quick look.

Thinker
07-05-2002, 01:18 PM
Collections are slow, and they slow down more and more the
more items you add to them. Depending on what you are doing,
an array would probably be much faster.

Mikecrosoft
07-05-2002, 01:21 PM
But if he don't use collection, what he will use ?

Matrix; is the same thing ?

BillSoo
07-05-2002, 01:22 PM
In this link:
http://www.pinnaclepublishing.com/VB/VBmag.nsf/0/BCC4647861194A45852568D80068D690
The authour was testing the speed of recordsets, but he used collections and arrays as comparison. It seems that the array has the edge over collection at most tasks....

Mikecrosoft
07-05-2002, 01:23 PM
This means that the recordsets is faster to do this ?

Teric
07-05-2002, 02:41 PM
BillSoo-

Interesting article. It appears that collections are good for some things, but can be out-performed easily if the programmer knows how to do it.

However, I wonder how that study would have changed if we had a situation where the program needed to iterate through each element of a list multiple times each second.

The writer didn't say anthing about linked lists. It seems to me that a linked list may be the way to go here, because I need to have a list that I can iterate through very quickly, and be able to add/delete list members on the fly.

Does anyone know anything about linked lists in VB? I downloaded ChiefRedBull's linked list class, and it looks good for a starting point. But does anyone know if a linked list is an efficient data structure in VB? Any advice?

At any rate, it looks like I'm going to have to get rid of my collections in lieu of a more compact, more efficient data structure.

*sigh* Time to rip my code apart...

BillSoo
07-05-2002, 02:49 PM
I like linked lists.

In VB, I usually simulate them with an array of structures (UDTs). Each structure has data members plus members that point to other indices in the array.

BillSoo
07-05-2002, 03:17 PM
It's been awhile since I looked at your collision detection code, but I seem to recall that you were checking for collisions between everything....

You can speed things up a bit if you only check some things...

1) Player bullets only check for collisions with enemy ships and asteroids
2) Enemy bullets only check for collisions with asteroids and the player
3) Enemy ships only check for collisions with asteroids and the player (not each other)
4) Player ship only checks for collisions with asteroids.

You could further simplify it if you only checked for collisions with objects that were on the screen. In that above example, that would mean only check for collisions with asteroids that were visible.

BillSoo
07-05-2002, 03:53 PM
Originally posted by Mikecrosoft
This means that the recordsets is faster to do this ?

No, that was just part of the article. Also, in answer to a previous question of yours, an array is indeed a matrix.

BillSoo
07-05-2002, 04:30 PM
I would also suggest either making all objects of the same type, or keeping them in separate lists, or using UDTs. As it is, with multiple types of objects in the objectlist, you need to use slow generic Object type variables, rather than declaring as a specific type of object.

My testing showed that well over 1/2 the time was spent checking on OBJECT collision. Only 20% or less on projectile collision. Not too surprising since there often are no projectiles on the screen.

Teric
07-05-2002, 04:51 PM
BillSoo-

Good suggestion on limiting the number of collision checks. I've done that already, using teams.

Each object has a team (Enemy ships on team 1, player on team 2, asteroids on team 3). Each object only checks for collisions with objects that are not on their team. (Projectiles are checked separately, and they only check for collisions with objects that are not on their team; no collision detection between projectiles).

Separating things into their own individual lists? Yes, that may be the way to go. However, I used to have them all separated, and it didn't seem to make a difference. However, after I get rid of collections and used linked lists instead, I might go that route for an extra performance boost.

Thanks for the suggestions!

ChiefRedBull
07-05-2002, 05:36 PM
Just a quick note on my linked list class - I am not completely sure that it frees up memory allocated. You see, once the handle to the block is returned, I tranlate it into a pointer, and the original handle is not stored. The process of releasing memory I *think* requires this handle, and not the pointer I translated it into.
It should be hard to fix it if it is a problem... I'll look into it. :)

BillSoo
07-05-2002, 05:53 PM
I made a modification to the code...now it just checks for collisions with objects that are actually on the screen...My percentages went to:
Movement code: 7%
Proj. Collisions: 43%
Obj. Collisions: 5%
Display code: 45%

Whereas before it was more like:
Movement code: 4%
Proj. Collisions: 19%
Obj. Collisions: 55%
Display code: 22%

Thus, the amount of time spent in the obj collision routine dropped immensely. Here is the code. It's *really* inefficient since I was just using this as a proof of concept...

Public Sub DetectCollisions()
Dim i As Long
Dim j As Long
Dim x As Long, y As Long
Dim minX As Long, maxX As Long, minY As Long, maxY As Long
Dim Obj1 As Object
Dim Obj2 As Object

minX = gSector.DisplayX: maxX = minX + gDisplayWidth
minY = gSector.DisplayY: maxY = minY + gDisplayHeight
Dim colScreen As New Collection
For i = mCol.Count To 1 Step -1
x = mCol.Item(i).MidX
If (x > minX) And (x < maxX) Then
y = mCol.Item(i).MidY
If (y > minY) And (y < maxY) Then
colScreen.Add mCol.Item(i)
End If
End If
Next i

For i = colScreen.Count To 1 Step -1
Set Obj1 = colScreen.Item(i)
For j = i To 1 Step -1
Set Obj2 = colScreen.Item(j)
If Obj1.Team <> Obj2.Team Then Obj1.DetectCollision Obj2
Next j
Next i

'For i = mCol.Count To 1 Step -1
' Set Obj1 = mCol.Item(i)
' For j = i To 1 Step -1
' Set Obj2 = mCol.Item(j)
' If Obj1.Team <> Obj2.Team Then Obj1.DetectCollision Obj2
' Next j
'Next i

'Free memory
Set Obj1 = Nothing
Set Obj2 = Nothing
End Sub

BillSoo
07-07-2002, 04:21 PM
I've been working on increasing the speed of this program and I put in a lot of small optimizations, however, I just could not get it to go past 32 FPS....then I realized that there was a FPS limit loop in the main event. Removing this got me 80fps on a P500 in IDE mode.

I'll post the revised source later...

Teric
07-08-2002, 08:24 AM
BillSoo-

80 FPS? Wow! That's great! I'd love to see the revisions that you made.

However, going on your previous note--I understand why you limited collisions to on-screen objects only. However, in the scope of this game, I really want to run off-screen collisions as well, because I want off-screen interaction between objects (like asteroids striking a starbase...).

BillSoo
07-08-2002, 10:17 AM
Most of my revisions were relatively minor. The big one was limiting collisions to on-screen objects. I gave each object a Visible property and set it to true/false in the draw method (I also wrote a generic routine to check visibility). If the object was visible, then you checked it for collisions.

I've attached the code. However, I may have introduced a bug.....I notice that sometimes, the screen freezes when a UFO blows up....so take care.

BillSoo
07-08-2002, 12:03 PM
I just noticed that the Webmaster announced that attachments posted this week will probably be lost....so download it now if you can...

Teric
07-08-2002, 03:09 PM
Got it, thanks.

LordHelmut
07-08-2002, 03:28 PM
For some reason it will not run on my comp. My comp is a Pentium II 500mhz and 384 megs of ram with a voodoo 3 3000 card. It should run fine but it just freezes. I tried compiling it and running too but it just freezes. Im not sure if I am the only one it happens to but I am really looking forward to playing this revised version with a greatly increased FPS.

BillSoo
07-08-2002, 03:38 PM
Well...sorry about that....it looks like I may have added a bug as I said....

LordHelmut
07-08-2002, 03:46 PM
I figured even though you said there was a bug it would still be playable. I am just saying I was having problems. Dont worry about it :cool:

Hey Bill, we need a version of you for DirectX. All the BitBlt people are set, we need someone. The closest we have is Pookie (hes kick ) and a few others who are pretty good like JimCamel and DrunkenHyena. I am trying to master it but im far from it. :)

BillSoo
07-08-2002, 04:14 PM
AHA!!! I found where I added the bug. In the form code, form_load event. I changed your GetTickCount routine to one using TimeGetTime. In the process, I changed the timer code to

While TCountStart > timeGetTime()
DoEvents
Wend


This is wrong because sometimes the mainloop takes too long and timeGetTime is immediately higher than TCountStart, which means that DoEvents won't fire. And you have to fire it at least once per loop. So change the code to:


Do
DoEvents
Loop While TCountStart > timeGetTime()


And hopefully it will be fine.

LordHelmut
07-08-2002, 04:37 PM
Thats rather awesome! I only got 10 FPS but I had a lot going (winamp, graal, and some other stuff that is a RAM hog) so no bad reflection on you. The game is incredibly fun accept for one thing. Should you like blow up when you hit other ships and rocks rather than bouncing off of them?

BillSoo
07-08-2002, 05:20 PM
Originally posted by Teric
However, in the scope of this game, I really want to run off-screen collisions as well, because I want off-screen interaction between objects (like asteroids striking a starbase...).

You still don't need to check for ALL offscreen collisions. In this case, you could set up a virtual viewport around your starbase. Thus you would check for collisions between objects in your actual viewport and a separate check for collisions between objects in your virtual viewport.

BillSoo
07-08-2002, 05:27 PM
Originally posted by LordHelmut
Thats rather awesome! I only got 10 FPS but I had a lot going (winamp, graal, and some other stuff that is a RAM hog) so no bad reflection on you. The game is incredibly fun accept for one thing. Should you like blow up when you hit other ships and rocks rather than bouncing off of them?

Really? Even my pathetic P300 here at work gets 19FPS....

I think Teric is working on the collision code so we'll have to see how he handles it. Right now, I use the asteroids to change deltaV rapidly. It helps to shake off pursuit at times.

BillSoo
07-08-2002, 09:20 PM
Hmmm.....on my P500 at home I got 28 FPS on my system instead of 80....

Then I closed Netscape and I got 79FPS. It appears that other apps really make a big difference.

BillSoo
07-09-2002, 02:46 PM
Minor bug: I noticed that most of the objects are missing the gDisplayX and gDisplayY offsets when being drawn. They should be added like:

ScreenX = (mvarX - .DisplayX + gDisplayX + .SizeX) Mod .SizeX
ScreenY = (mvarY - .DisplayY + gDisplayY + .SizeY) Mod .SizeY

In the DRAW method of most objects.

Teric
07-11-2002, 03:48 PM
Update!

1. I got rid of all my collections and am now using doubly-linked lists. Collision detection speed has increased--not astronomically, but better than it was with collections.

2. Ships (including your own) will now take damage when colliding with asteroids.

Enjoy!

BillSoo-

I looked through my code, and I ensured that all objects include + gDisplayX and + gDisplayY in their Draw methods.

BillSoo
07-12-2002, 01:12 AM
I see you went back to global collision detection.....ah well....

On my home system, it slowed down to 12 FPS, after I killed a bunch of UFOs, it increased to the 32FPS max.

I then checked your collision routines and of course, the big timeconsumer was the one where you check every UFO against every asteroid.

I then modified the collision code as follows:
1) I split the map into 16 sectors by superimposing a 4x4 grid over it.
2) For each sector, I determined which asteroids and ships were in it
3) I then checked for collisions between objects in the same sector

The framerate sped up to 19 FPS which was good, but I thought I'd play around with the number of sectors.

The best I've found so far, is 4 sectors. With this scheme, I get 24fps which is about double what it was. I expect that other routines are now limiting the speed. Anyway, here is the code:

Public Sub DetectCollisions()
Dim Obj1Node As ListNode
Dim Obj2Node As ListNode
Dim aAsteroids(20) As Object
Dim aShips(20) As Object
Dim nAsteroids As Long
Dim nShips As Long
Dim x As Long
Dim y As Long
Dim dx As Long
Dim dy As Long
Dim i As Integer, j As Integer

dx = gSector.SizeX / 2
dy = gSector.SizeY / 2
For x = 0 To 1
For y = 0 To 1
nAsteroids = 0: nShips = 0
Set Obj1Node = SList.GetFirstNode
While Not (Obj1Node Is Nothing)
If (Obj1Node.Object.x \ dx) = x Then
If (Obj1Node.Object.y \ dy) = y Then
nShips = nShips + 1
Set aShips(nShips) = Obj1Node.Object
End If
End If
Set Obj1Node = Obj1Node.NextNode
Wend
Set Obj2Node = gAsteroids.GetFirstNode
While Not (Obj2Node Is Nothing)
If (Obj2Node.Object.x \ dx) = x Then
If (Obj2Node.Object.y \ dy) = y Then
nAsteroids = nAsteroids + 1
Set aAsteroids(nAsteroids) = Obj2Node.Object
End If
End If
Set Obj2Node = Obj2Node.NextNode
Wend
For i = 1 To nShips
For j = 1 To nAsteroids
DetectCollision aShips(i), aAsteroids(j)
Next j
Next i
Next y
Next x
Set Obj1Node = Nothing
Set Obj2Node = Nothing
'Detect colllisions for each object in the list
' Set Obj1Node = SList.GetFirstNode
' Do Until Obj1Node Is Nothing
' Set Obj2Node = gAsteroids.GetFirstNode
' Do Until Obj2Node Is Nothing
' DetectCollision Obj1Node.Object, Obj2Node.Object
' Set Obj2Node = Obj2Node.NextNode
' Loop
' Set Obj1Node = Obj1Node.NextNode
' Set Obj2Node = gAsteroids.GetFirstNode
' Loop
End Sub

BillSoo
07-12-2002, 03:21 AM
It occurred to me that my previous routine goes through each list once per sector.....not good. It would be better if it just went through each list once.

So I modified the code to have a multidimensional array of objects, the first dimension is the objectnumber in a sector, the second is the sector.

I make one pass through each of the linked lists and assign each object to the proper element of the array. Then I go through the arrays sector by sector.

I played around with sector size and I think 16 sectors seems best on my system. I got 37 FPS with it after I turned off the FPSlimit.

Public Sub DetectCollisions()
Const DIVBY = 4
Const MAXSECTOR = 15 'equal to DIVBY * DIVBY - 1
Dim Obj1Node As ListNode
Dim Obj2Node As ListNode
Dim aAsteroids(20, MAXSECTOR) As Object
Dim aShips(20, MAXSECTOR) As Object
Dim nAsteroids(MAXSECTOR) As Long
Dim nShips(MAXSECTOR) As Long
Dim x As Long
Dim y As Long
Dim dx As Long
Dim dy As Long
Dim i As Integer, j As Integer, k As Integer

dx = gSector.SizeX / DIVBY + 1
dy = gSector.SizeY / DIVBY + 1
'sort into sectors
Set Obj1Node = SList.GetFirstNode
While Not (Obj1Node Is Nothing)
i = ((Obj1Node.Object.x \ dx) + DIVBY * (Obj1Node.Object.y \ dy))
nShips(i) = nShips(i) + 1
Set aShips(nShips(i), i) = Obj1Node.Object
Set Obj1Node = Obj1Node.NextNode
Wend
Set Obj2Node = gAsteroids.GetFirstNode
While Not (Obj2Node Is Nothing)
i = ((Obj2Node.Object.x \ dx) + DIVBY * (Obj2Node.Object.y \ dy))
nAsteroids(i) = nAsteroids(i) + 1
Set aAsteroids(nAsteroids(i), i) = Obj2Node.Object
Set Obj2Node = Obj2Node.NextNode
Wend
For i = 0 To MAXSECTOR 'for each sector
For j = 1 To nShips(i)
For k = 1 To nAsteroids(i)
DetectCollision aShips(j, i), aAsteroids(k, i)
Next k
Next j
Next i
Set Obj1Node = Nothing
Set Obj2Node = Nothing
'Detect colllisions for each object in the list
' Set Obj1Node = SList.GetFirstNode
' Do Until Obj1Node Is Nothing
' Set Obj2Node = gAsteroids.GetFirstNode
' Do Until Obj2Node Is Nothing
' DetectCollision Obj1Node.Object, Obj2Node.Object
' Set Obj2Node = Obj2Node.NextNode
' Loop
' Set Obj1Node = Obj1Node.NextNode
' Set Obj2Node = gAsteroids.GetFirstNode
' Loop
End Sub

Teric
07-12-2002, 04:36 AM
BillSoo-

That's great! Using your code, I was able to increase the number of AI Ships to 60, and the number of asteroids to 40, and I still got a good framerate.

I had thought about dividing up collision detection into sections, but I had never sat down & done it. Thank you so much!

Teric
07-12-2002, 08:13 AM
I have found a problem with your code, BillSoo--

When you get a large number of ships all grouped closely together (such as when you've got 20+ ships on your tail), your code errors out because it can't handle more than the 20 objects you set it up to handle. (By the way, I re-named your little collision detection areas as SECTIONS instead of SECTORS, because I want the whole area of space to be a sector.)

I could simply increase the number of obects that a section can handle at a time, but it will start to eat up a lot of memory if I set it too high. I wonder where the trade-off is.... should I set a maximum number of AI controlled ships & asteroids that can be in a sector at a time?

BillSoo
07-12-2002, 10:09 AM
Well, you could just make the array dynamic....

I was going to do it that way, but I saw that there were only 20 ships and 20 asteroids being created, so I just hardcoded the arrays to that size.

To make a dynamic array, you would have to switch the dimensions so instead of aShips(nship, nsection) it would be aShips(nsection,nship). this is because only the last index of an array can be redimensioned.

Since Redim Preserve takes time, I would set the intial size to 20, then if the numbers in a section got too high, I would increase it by another 20.

Or you could just hardcode it. After all, these arrays only hold pointers to objects so I don't think the memory usage is too high.

Teric
07-12-2002, 10:21 AM
Arrays only hold pointers to objects? I didn't know that! If you're sure about this, I could go ahead and hard code it to 100 (I don't plan to ever go higher than that).

You've been a big help, BillSoo! Thanks!

Thinker
07-12-2002, 11:00 AM
Originally posted by Teric
Arrays only hold pointers to objects? I didn't know that! If you're sure about this, I could go ahead and hard code it to 100 (I don't plan to ever go higher than that).
If the array element is an uninitialize object, it will have a value of
0. An array of 100 objects takes up 400 bytes (plus the few
overhead bytes for the Safearray structure). This is also true of
strings. ReDim Preserve to a larger size causes a new allocation
of memory large enough to hold the new array, and a copy of all
values to the new memory. ReDim Preserve to a smaller size only
truncates off the elements, requiring no memory move.

BillSoo
07-12-2002, 11:32 AM
From MSDN, excerpt from Data Type Summary:

Object 4 bytes Any Object reference


Makes sense since you can't use an object variable until you either create new space for it using the NEW keyword (dim sh as NEW Ship) or assign it to an existing object using the SET keyword (Set sh = gobjects.NextObject)

Teric
07-22-2002, 01:24 PM
Sorry I haven't posted for a while.

I'm currently working on making a Weapon class, which will allow creation and switching of weapons easily.

The weapon class allows a weapon to have multiple shots (up to 5 at this point). Each shot is generated separately, and has its own heading, damage, sprite, speed, etc. Thus, the weapon class can handle the simple pea shooter (single forward shot), a spread weapon (5 shots fanning out), or a weapon that fires a large shot out the front and two smaller shots to either side.

Eventually, what I'd like to do is allow the player to configure their own weapons (i.e. number of shots, power of shots, shot spread, firing delay, rear/side/forward shot, etc.).

I hope to have an update soon which will show various weapon possibilities.

Teric
07-22-2002, 04:15 PM
Update!

I have implemented a Weapon class, which allows easy encapsulation of weapon attributes.

Hit the Z key to switch weapons--there are currently 8 usable weapons.

See if you can go through my code and figure out how I did it--you can create your own weapon configurations and add them to the weapons list.

Enjoy!

aaa
07-22-2002, 11:18 PM
what happen to the tie fighter?

hey teric you gotta make your weapons look better
i mean i made a weapon system like yours ages ago, although it did run slow, ididnt know much about vb back then
but i just drew lines or orangish colour for the bullets and they looked great

(although u probably intend to make it better)

you are making a great game tho

just wandering if u ever placed subspace?

ChiefRedBull
07-23-2002, 05:39 AM
Brilliant teric - I like the multidirectional weapons :)

It is running a little slower though.... :(

hotrodx
07-24-2002, 08:38 PM
To aaa:

The Tie Fighter is Genzo's modification of Teric's game.


To Teric:

Nice weapons. Although I managed to do a berserk mode: hold down "z" and space at the same time.

I don't think you intended it to be that way. Nice, though.

Teric
07-25-2002, 09:40 AM
Hey, I never tried that, Hotrodx. Heh... good find.

I plan to put a timing delay on switching weapons, so your berzerk mode won't be possible.

Thanks for checking it out!

hotrodx
07-25-2002, 09:46 AM
Awww....

Teric
07-25-2002, 03:47 PM
Yeah, I know berzerk mode is fun, if you just want to go on a destruction rampage. I just tried it--it essentially makes you invincible, with projectiles flying all over the place.

However, I don't want to make this game TOO easy, so I'll have to... um... er... (cough)... NERF (*gasp* I said it!!) that option.

hotrodx
07-26-2002, 02:26 AM
lol!

Yeah, I guess you're right. I was also planning to include a super powerup in the game I'm making. However, it'll make the game too easy. One solution is to make the enemies harder, but what happens when you lost the powerup?

Bye-bye berserk mode...

Teric
07-26-2002, 03:00 PM
Another update!

1. Power-Ups! In the final game, you will sometimes be able to recover power-ups from destroyed asteroids or enemy ships. For now, I have set the game so every destroyed asteroid will release a power up. Powerups are as follows:

-Up Arrow: Extra speed
-Turning Arrow: Faster Turn Speed (Not perfected yet)
-$: Extra cash (credits)
-Shield: Extra shield power

In order to demonstrate the value of power ups, I have decreased the turning speed, flying speed, and maximum shields of your ship when you start out. WARNING: Enemy ships are now faster and more maneuverable than you are (at first).

2. I have added two more weapons to the weapon rotation (rotate weapons with z key): Multi Shot and Rapid Double Shot. Try them out.

3. Improved Scoring. It used to be that you would gain score even when enemy ships rammed into asteroids or shot at asteroids. This has been fixed so that you will only receive score if you make the hits. ALSO: Changed 'score' to 'credits'. In the final game, credits will be used to repair, refuel, and purchase upgrades to your ship, as well as to purchase other interesting things....

4. Collision Detection. I took BillSoo's idea a bit further and implemented it with all destructible objects (i.e. ships, player ship, asteroids, Power-Ups, etc.) I sectioned off the sector into smaller areas to limit the scope of collision detection for each object. While game speed still isn't PERFECT, it is significantly better, even when I have 30 asteroids and 50 enemy ships flying around the sector. THANK YOU, BILLSOO!!

Enjoy!

Mikecrosoft
07-26-2002, 03:14 PM
I have one suggestion:

When you push Z to change a weapon, the weapon changes fastly even when I try to push it a little, may be you must add a break to one push is one change and not more. But the game is good, have a lot of weapons and this is great !

Good job !!

Mikecrosoft
07-26-2002, 03:21 PM
Other suggestion, may be you can use the number buttons to load a weapon 1-Mixed 2-Rear ,3-...... of this way you can select the weapon that you need quickly, is a lot of enemy ships is behind me I can push the button number that select the rear weapon. Like Doom or some 1st person game.


Ok is other idea !

jeremyrharris
07-26-2002, 11:17 PM
I downloaded your game and played it....WOW! That is so cool! I mean, I know how hard this programming stuff is so I admire your work. Can't wait till I can play the whole thing! Oh and I didn't know how to use classes in VB (I know how to in C++, but they have dif syntax and stuff), but after reviewing your code, I made my first class. And now I am working on a class that will do all my game stuff. Is that what an "engine" is? Is an engine a class that has a bunch of functions and stuff? Anyway...soooo cool!

jeremyrharris
07-29-2002, 12:30 PM
Teric: I played your game the other day and I noticed it takes a long time (well about 4 seconds) to finish loading. Maybe you could put a little progress bar for loading onto a form and have it show the loading process instead of having to wait. Then again, my computer could be just too slow for this game. LOL. Great game though, I had to cheat an change the die routine in your player class to return false. Then I could never die and really play your game without worrying about dieing and having to start over. Lots of fun!

OnErr0r
07-29-2002, 01:57 PM
Nice Game.

btw, mvarPrimaryWeaponSpeed in PlayerShip class is undefined.

say.. how about some sound? :)

Teric
07-29-2002, 04:12 PM
Quick Update!

1. Resources have been added. Metal Ore, Precious Ore, Radioactives, and Ladrium Crystals will now emerge from some destroyed asteroids. In the final game, these can be brought back to your starbase for processing. Look carefully, resources are very small and you may miss them if you don't watch carefully. They twinkle a bit to let you know that they're out there. Be sure to pick them up quick, because they don't stay out there for too long.

2. Text blurbs now show up when you pick up power ups. These text blurbs will tell you what you picked up.

Enjoy!

BillSoo
07-29-2002, 04:21 PM
I find it really hard to pick up the powerups...it's hard to even shoot down the asteroids.

With the UFOs, they come to you so all you have to do is fire in their general direction and they walk into it. With asteroids, you have to match trajectories, close the range and (possibly) lead your target. When I free a powerup, it usually gets away unless I happen to be right beside the asteroid when it blows up.

UFOs could be tougher if they didn't match your orbit and took flyby shots instead. Especially if they were smart enough to "lead" you.

Iceplug
07-29-2002, 04:58 PM
Nice game! :D

I like the items and the asteroids.

I did find the items difficult to get. They're very tricky to see. :p Especially the metal ore.

I like the text too.
The weapons change quickly too. Maybe the Z should respond to only the KeyDown event. :)

Teric
07-30-2002, 08:48 AM
Yeah, I think you're right--the resources are too small and difficult to see. I'll make them a bit larger.

Great idea, Iceplug--I'll force the user to re-press Z for each weapon switch.

Teric
07-30-2002, 03:41 PM
Another quick update.

1. Made resources a bit bigger and easier to see.

2. Implemented IcePlug's idea to force the player to re-press Z for every weapon change (No more berzerk mode, HotRodX!)

3. Used some of Genzo's UI graphics to implement a cargo window, which shows how much of each resource you've picked up.

Enjoy!

Iceplug
07-30-2002, 04:10 PM
I noticed the items were bigger this time... :)

I did find a graphical bug... when collecting an item while going left at full speed, the popup text bleeds onto the window side where it doesn't get updated.

Teric
07-30-2002, 07:36 PM
Yep, you're right, IcePlug. I used to clip text to the viewscreen, but in order to blit text to the Cargo window, I had to take out clipping code. The 'bleed' effect will be taken care of when the rest of the UI is implemented.

Good eye!

Genzo
08-01-2002, 03:58 AM
I thought i let you know keep up the good work.

If you want I can make more graphics for your game (sectors).
I have also started to import it over to directdraw in fullscreen mode.

I have started to change my GUI(Graphical User Interface) that I made, to a new one which will be a more futuristic version. I have made a database with some weapons that you might want in your game? over 100.

I have attached some Asteroid graphics that you might like?

Teric
08-01-2002, 07:56 AM
Sounds great, Genzo. I'll consider any graphics you send my way.

Looking forward to the new GUI graphics.

100 weapons, huh? Sure, let me take a look at them.

Thanks for your help!

Mikecrosoft
08-01-2002, 08:59 AM
If you need help to change your game to DirectX (DirectDraw) tell me too, I can and want help !!!

Genzo
08-01-2002, 11:24 AM
How would you like me to send stuff to you. Post it on here?

For all you people out there that like space games try this one.

Continuum, which is free and fun to play its an online game.
http://subspace.net/

I have designed Spaceship graphics of the Shadow out of Babylon 5 and have used it in sectors.

Idea

You could have different asteriods that are made of different matrials which do different damage and release serten matrials of what they are made of.

Teric
08-01-2002, 11:49 AM
Genzo-

Sure, post them here, or you could send them to me by e-mail:

j.rob.wilson@exxonmobil.com

Genzo
08-05-2002, 08:54 AM
Questions

What things do you like in a space game?
Like to be able to design your own space ship, Hire polts ect.

What is the most annoying things in a space games?

What keeps you intrested?

Teric
08-05-2002, 03:34 PM
Likes: Fast action, dogfights, lots of different factors that affect play (ship speed, fuel capacity, weapon speed/range/damage, etc.), ability to upgrade. Think Star Control II here.

Annoying: HUGE, impossibly complex spaceships created by hyper-advanced races bent on destroying all life. If a race is so advanced, why do they need such GIGANTIC ships to destroy everything? (For example, the Borg. They were a great storyline in Star Trek, but why do their ships have to be so flipping huge and complex?!?! Another example)

Keeps me interested: figuring out new strategies, new ways to defend/attack, encountering new friends/enemies, working towards that next upgrade.

Genzo
08-06-2002, 04:22 AM
Like: My likes are the same as Teric's, but I do like to be able to build a base, ect Buildings, guns.

Annoying: Cheaters, over powered ships, weapons and anything else.

Keeps me intrested: Lots of game play, Action, Challenging and the most important lots of controls.

aaa
08-06-2002, 08:38 PM
i know this sorta goes off teric's games current style but
an idea is to be able to construct a fleet of ships? strategy style control maybe or just have them follow your main ship in formation styles whatever

matticus_99
08-06-2002, 10:48 PM
For example, the Borg. They were a great storyline in Star Trek, but why do their ships have to be so flipping huge and complex?!?!
I think the idea here is because they assimulate other races they need the immense size to regenerate drones, convert the capatured into drones and add young drones to maturation chambers.

Teric
08-07-2002, 07:51 AM
aaa:

That is indeed in the plans. I would like to allow the user to build allied ships to do different jobs (such as mining resources, accompanying the player in battle, guarding the starbase, etc).

matticus_99:

Understood about the Borg. I see how it fits into the story and makes sense, but it also seems to be a really common theme: the big bad aliens bent on taking over have a huge, impossibly complex ship. (Have you seen the movie 'Independence Day'?)

matticus_99
08-07-2002, 04:21 PM
Yeah they all seem to be insanely large.

DrunkenHyena
08-07-2002, 10:24 PM
It'd be much harder to convey that level of fear and intimidation if the aliens showed up in an Austin Mini.

Genna
08-08-2002, 12:55 AM
Orignally posted by Teric

I would like to allow the user to build allied ships to do different jobs (such as mining resources, accompanying the player in battle, guarding the starbase, etc).

Maybe you can try manufacture->upgrade weapons, engines, shields??? I know it is a long way to go but just a thought

another thing, maybe you can hire mercenaries to help you get through missions??

aaa
08-08-2002, 06:57 AM
or just have better ships up the line, but
to make each ship sorta unique u could have like points for the ship
-speed
-weapons
-shields
-firerate
like u put certain amount of points on each

Teric
08-08-2002, 08:36 AM
aaa, are you reading my mind or something? :)

I plan to allow the player to build better/more powerful ships later on, and to upgrade his own ship (turn speed, fire rate, hull plating, shields, cargo space, thrust factor, maximum speed, etc.)

Genna-

Much like hiring mercenaries, you will be able to purchase/build robotic drones with varying levels of artificial intelligence to accompany you, fight for you, defend you, mine resources, defend starbases, scout, attack, etc.

Right now, I'm working on putting starbases in. I've got the model for them done, now I'm working on creating the object and how it interacts with the player and the environment.

Teric
08-08-2002, 02:18 PM
Small Update...

1. You now have a starbase. Currently, the starbase simply sits in one place in the sector, and can be hit (and conceivably destroyed) by enemy fire. On the other hand, current enemy ships are pretty stupid, and mostly ignore the starbase as they come after you.

2. Sprite clipping. I didn't like how the whole sprite would 'pop' on to the edge of the display when it came into view. I implemented some code to 'clip' sprites so that, if they are only partly visible, only the visible part will be blitted.

Enjoy!

aaa
08-08-2002, 11:31 PM
maybe make more rotation points on star base..

i really think you should remove all collision detection between ships

as to simulatate the height differences

as its much faster but id reakon looked better

Teric
08-09-2002, 08:12 AM
You're probably right, the starbase could use smoother rotation. However, I've got 12 frames already, and each frame is 128 x 110 pixels (for a total of 496K). In order to make it smoother, I'd have to increase that to 18 or 24 frames, which would increase the .bmp file size to nearly a megabyte (OUCH). Maybe I could do it a different way, however... I'll think about it.

Collisions between ships only occur if the ships are on different teams (i.e. enemies colliding with you or your starbase). So I am already eliminating most ship-to-ship collision detection anyway.

Any feedback on my starbase model? Good? Cheesy?

Iceplug
08-09-2002, 10:30 AM
Seems to run a bit faster... maybe that's just this computer.

I also see a little bit of text bleeding at the bottom of the form.

Also, I seem to have been unable to collect a couple of items.
Is there a maximum amount of items that you can carry.
I had 38 of the gray things (Metal Ores, I think) and I couldn't get anymore. Maybe it should be truncated to 40 and the leftovers are discarded.

Starbase looks good... what will it be doing?

Teric
08-09-2002, 01:01 PM
Yeah, I discovered a bug with resource collection. You're supposed to be able to carry (at first) 50 units of resources in your cargo bay. However, the cargo collection routines are doing funny things--working on them today. (EDIT: Fixed with next release)

You will be able to dock at starbases to offload resources (cashing them in for credits). You will also be able to purchase upgrades to your ship, configure weapons, build drone ships for various duties, and other things. I'm working right now on enabling you to offload resources to a starbase.

Teric
08-09-2002, 03:33 PM
Update!

1. Starbases now slowly drift through space

2. You can offload resources at a starbase, cashing them in for credits. Resources now have value--metal ore is least valuable, then precious ore, then radioactives, then ladrium crystals (most valuable).

3. When you dock with a starbase, it will repair your hull and shields up to their maximum value

4. I've adjusted the release percentages of resources to reflect their value. Less valuable resources are more likely to be released from an asteroid than more valuable resources.

5. Enemy and asteroid re-spawn. Now, when you destroy an asteroid or an enemy ship, a new one will respawn somewhere else in the sector.

Enjoy!

dddude55
08-10-2002, 05:33 PM
i like it it keeps getting better and better

Pookie
08-10-2002, 11:20 PM
Maybe I haven't been following this close enough, but where and how to do use this power weapons?

Teric
08-21-2002, 01:30 PM
Update!

1. BIG asteroids! I thought the asteroids that I had were pretty wimpy-looking, so I rendered a big asteroid sprite. Now, asteroids start out as big chunks of rock, and can be broken into smaller asteroids.

2. Repairing your hull at the starbase now costs a small amount of credits per unit repaired.

3. The amount of credits received for destroying enemies has been reduced.

4. When you are docked with a starbase, you can hit the enter key to open the purchase window. Currently, this window shows your current ship stats (sorry, can't buy anything yet).

The purchase window will obstruct your view of the main screen, but the action will continue while you make purchases. CAREFUL--I've sat at my starbase staring at the purchase window while a flock of enemies blew my starbase out from under me!

Please let me know if you find any bugs.

Enjoy!

chris00
08-21-2002, 01:38 PM
Teric very (very very very very ...) nice :) :D :cool:
Was a little slow on my computer though.
Don't realy have any suggestions.

Iceplug
08-21-2002, 01:45 PM
Great updates!

I found it a lot more difficult. :)
I just noticed that the starbase is actually moving on its own.

Seems like there are also more enemy ships this time.

One other thing: it's rather tricky to reach for the Enter key while at the base before it's gone. Maybe just me, I don't know. :confused:

Teric
08-21-2002, 02:14 PM
Iceplug:

Try using the brake (down arrow key) when you dock with starbase. It will help to slow your speed so you can match the starbase's speed. That should give you a bit more time to hit the enter key.

If it's still difficult, maybe I can switch the keys around a bit to make it more intuitive. Let me know.

jsharbour
08-22-2002, 06:09 PM
First of all, great game Teric! To improve the performance of the game, I would recommend you turn off AutoRedraw and update the screen yourself using a double buffer. AutoRedraw is a frame rate killer. Maybe you are double buffering already....I haven't looked into the code thoroughly yet. I'll take it home and check out the game more after work.

But after just playing it for a few minutes, the game looks very cool! I love flying around asteroids and having the enemy ships crash. Hilarious! Ha ha ha ha! It looks like you've got the graphics looking really solid. At work I have a Dell 2.2GHz system so obviously it's really fast. I think my 850MHz laptop at home will be a better test for the game. 2D games just can't be tested on very fast PCs if you know what I mean. Timing wasn't a problem, though. Just may need to have the frame rate limits put back in. (I've read all the posts on here so far).



Regards,

Jonathan Harbour



:cool:

jsharbour
08-22-2002, 06:19 PM
Now, again just perused it, but I have to say, you have GOT to make this a multiplayer game. I have code that uses a Winsock control array and supports up to 255 players on a dedicated game server program. With just a tiny bit of modification you could use Stellar Server with your Sectors game. The only problem is that it uses slow string packets. It needs to send byte packets which are 100x faster.

It's all in a class file, so easy to plug into your game. I'll help you integrate the socket code into your game....if you don't mind my helping? This game will be too cool with a dedicated server and everything.....

This Sectors game is exactly what I was striving to do in my Stellar War game except that I didn't have time to work on it. There are some graphical glitches in my game because I wrote it all in just two days (yes with the multiplayer stuff and bots!) so there are some DirectDraw bugs. BUT! Ignore that....I'm talking about just the socket code that could be easily adapted for Sectors. Man, just imagine how much fun, mining asteroids, getting money, and then what if you could upgrade to bigger, faster, more powerful starships? It would be sort of like the old Trade Wars game. Only your graphics look gorgeous. Yes, clearly inspired by Star Control. I would like to see some Starflight elements added, like a persistent ship and a character, those RPG aspects that made Starflight so cool.

Anyway Teric, I think we chatted a year ago because your name sounds familiar. I just started working on sort of a MOO2 clone (not DirectX) because my job is boring too. But your game is fun enough. :) I wonder if it will keep on growing and develop into a very cool multiplayer game with planets, ship upgrades, trading bases....you know like the old Trade Wars game....

Regards,

Jonathan Harbour

BillSoo
08-22-2002, 06:23 PM
JH: *Your* name is certainly familiar.....gone almost a year (except for a post a couple of months ago) yet I still remember you....

Well, welcome back.

jsharbour
08-22-2002, 06:47 PM
BillSoo,

Really, was that this site? I don't even remember being here before. But Teric's (real) name sounded familiar. Hmm. I don't know if it was this or some other forum. I was searching for "visual basic games" because I was bored at work and came here. Anyway, this is a very cool game and I'm glad I came across the thread.

Oh wait now, Rob, I remember! It was your tile editor that I used for Block Attack. Man, you know, I couldn't find your e-mail address or anything to give you credit for that. Actually I modified the heck out of it but still.... :) small world.

Well I'm seriously digging your Sectors game right now and think it's cool how this thread has been going on for so long. It must have been fun working on the game for so many months and getting such great feedback. Your particles and physics in the game are really cool.


Jonathan

jsharbour
08-22-2002, 10:16 PM
By stepping through the code for the Sectors game I determined that the excessively long startup time is due to the *ugh* ultra-slow mask generation code. Granted, the code works and it's a far cry from having to create masks and all that. But there's a faster way to do it. You want to grabs the bitmap buffer out of the picturebox and scan for the transparent pixels in a fast loop. The problem with Sectors is that it's using a slow "GetPixel" function and that is taking a long, long time to run. By using bitmapbits and by loading bitmaps into memory instead of using a picturebox, you can cut your load time down to practically nothing.

I could post up some code to do it but the problem is this game is using pictureboxes to store all the graphics on the form. To make the game load up instantly you would have to store the graphics in bitmap files instead. I don't know if Teric wants to do that. It would certainly optimize the whole game to use mask generation with the bitmapbits and avoid using pictureboxes (instead load the bitmaps into memory). And I don't want to give the impression that this isn't a cool game....because it is. I'm just offering a way to speed up load times and other things. For starters, I've attached my sprite class to this message, which includes the bitmap class that loads a bitmap file into memory and gives you a hdc to it.

The sprite class can grab tiles out of a bitmap and takes care of all the difficult aspects of blitting an animated sprite for you. So that would affect large portions of the Sectors source code as well. The bitmap class can also be used as a double buffer. So I'll just put the classes up here for you guys to play with and leave it to Teric if he wants to rewrite some of his code to use it. BTW, Teric, is the game double buffered? I haven't looked through the code enough to find that but it looks like you're just using AutoRedraw to double buffer.


Jonathan

Teric
08-23-2002, 08:32 AM
Welcome back, Jonathan! It's good to see you on this board again; I hope you stay this time. Skilled people like you would be a definite asset to this board.

Yeah, I went and looked at your book some months ago when it first came out. It was REALLY cool to see one of my own programs published!!

Currently, my game is not double-buffered. Nor does it use DirectX (developing at work, and can't use DirectX). Is there a way to effectively double-buffer without DirectX? I thought of using a virtual picturebox control that is declared at run-time, and blitting my sprites to it before I blit the whole thing to the main form. I don't know if that would speed things up or slow things down.

About the load times--yes, you're correct, the GetPixel/SetPixel functions are pretty slow. You suggest using bitmapbits and loading bitmaps into memory--how would I do that? I do indeed have all of my bitmaps saved in files; I simply haven't put them in the attachments to this thread.

Can your sprite class work outside of DirectX? (I guess I should take a look at it, huh...)

Again, good to see you back, Jonathan.

wyrd
08-23-2002, 01:01 PM
Well isn't this ironic.. I'm reading Jonathans book right now.. and also randomly found this site through a search engine looking for more vb/directdraw info (google.com). Me and a friend are going to try and make a game using the knowledged I've learned from it. :) Or atleast we'll try anyway. :-\

It's a great book. Even though I don't have the code memorized (that'll come with practice when I start coding my own game) I do understand the basics of making a game and what needs to be done with collision detection, double buffering, etc, etc. The only beef I have with the book is that there's only one chapter on DirectDraw and the book mostly focused on the windows API. I really wish it covered DirectDraw in more details. Also for some reason I don't get nearly the results on your DDFullScreen test that your example showed. When putting it in 32 bit it simply kills my FPS and I definitely can't get up to 500 sprites without my system coming to a screaming halt (800mhz athlon, g2mx, 256mb ram). The best I can do is 200 sprites in 16 bit color running at 25ish fps. Resolution doesn't seem to make a difference at all. Highest I went up to though was 1024x768.

Anyway aside from that, great book and I love it. Make a 2nd book please and focus more on DirectDraw/Direct3d :D Your fans demand it!

jsharbour
08-23-2002, 04:41 PM
Originally posted by Teric
Currently, my game is not double-buffered. Nor does it use DirectX (developing at work, and can't use DirectX). Is there a way to effectively double-buffer without DirectX? I thought of using a virtual picturebox control that is declared at run-time, and blitting my sprites to it before I blit the whole thing to the main form. I don't know if that would speed things up or slow things down.

I can relate to your situation at work, and am actually glad you're not using DirectX because it's a great example of what you can do without it. Just use my Bitmap class to create a double buffer and load all your graphics into Sprite classes. Then, when you do your blitting, the sprite class accepts a bitmap surface which works with the double buffer automatically. You just blit that double buffer to the main form. This class uses Windows bitmaps not anything built into VB....

About the load times--yes, you're correct, the GetPixel/SetPixel functions are pretty slow. You suggest using bitmapbits and loading bitmaps into memory--how would I do that? I do indeed have all of my bitmaps saved in files; I simply haven't put them in the attachments to this thread. Can your sprite class work outside of DirectX? (I guess I should take a look at it, huh...)

See the file I attached in my previous message? That contains two classes: Bitmap.cls and Sprite.cls. That code doesn't use DirectX. It does some advanced WinAPI stuff to read a bitmap from file into memory, create the mask, and do blitting. The sprite class uses that and can rip tiles out of a bitmap (like the ones on your form), and keeps track of position, velocity, transparency. So you can use those classes to enhance your game. All the code is built in, nothing you have to do but include them in your project.

I'll attach a another file to this message. This is the double buffer demo from my book so you can see how it works. You can write a whole game using just these two classes. Actually I did write two games using them....Warbirds and Block Attack. The latter is the game that uses Teric's tile editor for creating the levels.

jsharbour
08-23-2002, 05:06 PM
Originally posted by wyrd
The only beef I have with the book is that there's only one chapter on DirectDraw and the book mostly focused on the windows API. I really wish it covered DirectDraw in more details.


There are a bunch of DirectDraw chapters! The only WinAPI stuff are those first few that build the WinAPI graphics code for the first two sample games. I felt it was important to finally explain how to do this, just for cases like this Sectors game. I cover and/or use DirectDraw in chapter 6, 10, 13, 15, and 21. Direct3D is covered in chapters 14 and 22 (both huge). That's a lot! You can use that code to write a game with either WinAPI, DirectDraw, or Direct3D, and I included examples of each. That DDFullscreen and the DDSprite and DDSurface classes are all you need.


Also for some reason I don't get nearly the results on your DDFullScreen test that your example showed. When putting it in 32 bit it simply kills my FPS and I definitely can't get up to 500 sprites without my system coming to a screaming halt (800mhz athlon, g2mx, 256mb ram). The best I can do is 200 sprites in 16 bit color running at 25ish fps. Resolution doesn't seem to make a difference at all. Highest I went up to though was 1024x768.


What you are encountering is a memory problem. I have 512MB on both my desktop and laptop used to write the code. So the number of DirectDraw sprites you can use is directly related to how much memory you have available. As for frame rate I'm not sure. I took those screenshots from either my Duron 900 (GeForce1) and P3-850 (ATI Mobility-M4). Certainly similar to your PC.


Anyway aside from that, great book and I love it. Make a 2nd book please and focus more on DirectDraw/Direct3d :D Your fans demand it!


I'm working on a sequel for advanced VB programmers that focuses entirely on Direct3D. My first one was mostly a 2D book for beginners. This second one will be just 3D and the theme is multiplayer RPGs.

But anyway, back to Teric's game, eh? I wanted to mention that anything you can do with DirectDraw can be done as easily with D3DXSprites. Having some 3D in the scene is up to you, but the cool thing about D3DXSprite is that you can scale your sprites however you want at runtime with no slowdown. That might be a cool feature like in Star Control II how it would zoom in and out depending on the distance between two ships. Another benefit is that you can have small and large asteroids without any extra effort. You could even scale the asteroids randomly when the game starts. That would be very useful!

Teric what did you think about the idea of expanding the game into sectors and quadrants and make a whole persistent galaxy on the server with multiplayer support? It would be a remake of the old Tradewars BBS game. Is that too ambitious? I love the fact that this is in fact NOT DirectX, and it runs in a window. I could play it at work.... :)


Jonathan

Teric
08-24-2002, 10:40 AM
Jonathan-

That was my original plan, to (eventually) make it with multiple sectors and quadrants, and have it be multi-player.

The original concept was to create a semi-RTS game that focuses heavily on action and space combat. I wanted to have a number of sectors grouped together, and each player starts in their own sector with their own starbase.

When enough credits are earned, a player can build a stargate to warp to an adjacent sector. In the new sector, the player can mine resources, clear out pirates (computer controlled ships), even build another starbase (if they have enough credits).

jsharbour
08-27-2002, 05:03 PM
This game reminded me of the old (or rather ancient) game called PDTrek, which I used to play with friends over modem. It was just CGA, but very well done when there were NO commercial one-on-one modem games, back around 1987 I think. PDTrek has so much crammed into a seemingly simple game. It was quite amazing. You could build a base and transfer energy to it to make the base grow, and then it would turn into a big starbase. =)

When will the next version of Sectors be posted on here? Do you want to convert the game so it uses memory bitmaps and files instead of PictureBoxes? That would be a very good improvement because then you could start using a double buffer in the game (which will stabilize the frame rate for all PCs).


Thanks,
Jonathan

Machaira
08-27-2002, 09:56 PM
Tried to compile and got three errors. I believe I downloaded the latest version, but possibly not.

1) In the PlayerShip class you have Property Let and Get for mvarPrimaryWeaponSpeed but it's not declared.
2) In the Property Let TurnSpeedLevel you're doing an Exit Sub twice which should be Exit Property.

HFICKER
08-28-2002, 12:57 AM
i think that you did a good job on the game i just started programming so i dont really know much but i think you did a good job.

Teric
08-28-2002, 08:20 AM
Machaira--

Thanks for finding those bugs--I'll make sure to correct them in the next version.

HFICKER--

Thanks for your comments! It's great to be appreciated. :)

JSHarbour--

I've downloaded and printed out your Sprite and Bitmap classes. Yesterday, I started going through them with a fine toothed comb so that I could come to understand how they work. I do want to implement double buffering in my game; I will incorporate your classes.

Yeah, I played PDTrek once or twice--it was pretty amazing that they could get that kind of remote multi-player functionality into a game clear back in 1987. :)

Next version of Sectors will include JSHarbour's classes--can't say when it will be posted. Please check back often.

jsharbour
08-28-2002, 12:20 PM
Originally posted by HFICKER
i think that you did a good job on the game i just started programming so i dont really know much but i think you did a good job.

Oh, absolutely, this game is a blast. I love crashing the UFO's into the asteroids when they follow me around. Exactly like one poster put it, this reminds me of Empire Strikes Back. Very very cool game. I look forward to even more features. The collision detection is very good.

The thing that strikes me as most appealing is that the Sectors game at this moment is a very good framework for any number of spin-off games on various themes. It could be a fast-paced shooter or a space RPG or a multiplayer game. So many opportunities to turn this into several types of games. Or it could keep the fun gameplay and add more depth. But nothing would be quite as cool as adding multiplayer capabilities.

Rob, can you do a windows update on your work PC? If so then you could install DirectX right? Then it would be possible to add DirectPlay to the game. If not, that's cool, there's always Winsock. I actually used winsock in my Stellar War game instead of DirectPlay because it's easier to use. It took me a LONG time to figure out DirectPlay. And you know, DirectPlay basically sits on top of the Windows Sockets API. The only drawback, if you don't mind this point, is that my winsock code uses a winsock control array on a form. Each time there's a new player that joins the game, it adds another winsock control to the array (or deletes one when a player leaves). Basically, do you want to completely avoid DirectX and use winsock, which is wayyyy easier to understand, or go with DirectPlay? I'm sort of leaning on winsock. I would love to help. It would be so cool playing co-op to clear each sector.

Are you thinking about how to add new playability to the game as far as when you clear out a sector? You could have wormholes in each sector that takes your ship to another sector (and back again). Imagine 10-20 players in a co-op game. That would be pretty cool! It would be necessary to add some new opponents to the game, like some bigger alien ships. It would then be sort of like Armada on the Dreamcast.

But personally I'm hoping this game will start to take shape and be a sequel to that classic PDTrek. As such, each player in the game has a starbase that starts out very small. You have to collect energy with your ship and deliver it to the base to make it grow into a full starbase. While that's going on, players will try to destroy each other's starbases. This is the point where you spawn from when your ship blows up. So if you lose your starbase, you can't respawn, and are effectively out of the game. Since Sectors already lets you collect minerals from asteroids, it's already perfectly suited for that! But perhaps instead of growing the starbase, you can just add new features to it, like defenses and ship upgrades.

Another cool thing might be to require players to actually build their starbases first using asteroid materials. That would add to the challenge. First player to build a starbase would have an advantage--but would also be a target! Given that this takes place across multiple sectors would make this a significantly fun game.

Jonathan

Machaira
08-28-2002, 12:33 PM
Multiplayer would be VERY cool. And once you implement double-buffering it should be smoother. I only tried it for about 5 minutes but it was very well done.

Teric
08-29-2002, 07:49 AM
No possible way to upgrade my machine here at work, Jonathan. This is ExxonMobil--probably the BIGGEST bureaucracy outside of the US Government. If I were to make any unauthorized installations on this machine, the sirens would go off and the Gestapo would come and haul me away. Bottom line: no DirectX at all.

On the other hand, I would be happy to go with WinSock. However, that runs me into another problem--most internet activity is tightly filtered or blocked. Even if we were to get Sectors up and running on a multi-player server, I doubt I could hit that server from work. :(

Yes, yes! Multiplayer games will start out with each player in a different sector with a basic starbase. Players can mine resources, upgrade their own ships, (maybe upgrade starbases too!), and build AI-controlled ships. Eventually, when they have enough credits, they can build a stargate into an adjacent sector.

These stargates will go two ways, so any player can freely pass back and forth. (That makes for an interesting situation when a player builds a stargate to the next sector, and tons of enemy ships suddenly come pouring through.)

Still working on implementing your Bitmap and Sprite classes into Sectors. Question--why did you put collision detection code into the sprite class itself? Is there some advantage to doing it that way? It makes more sense to me to put collision detection in the objects themselves, or have a general collision detection routing that operates on objects.

MarkVB6
08-29-2002, 08:27 AM
Great game, Teric, and I seriously think you can make money off of it. This is like the live animated version of Planetarion (anybody play that internet game) where you start out developing and researching using minerals from asteroids, then go attack others for their resources when you run out. Yeah that'd be sweet.

hehe I just noticed something that you probably shouldn't change, because it's better this way, but:

In space, as you say, you do not slow down until an opposite force forces you to. Because of that, if you are firing the back rockets continuously, you should be continuously accelerating. Therefore, there should be no top speed, or, when top speed is achieved, technically the exhaust should stop pouring out the back.

MarkVB6
08-29-2002, 08:32 AM
Perhaps, to help you a bit, you could make an error log function, where we are the beta testers, and when we find a glitch, or an error, we can take a "snapshot" say by pressing F5. This logs all variables at that time and what line of code it was on. Then, we could post the logs here to help you.

Teric
08-29-2002, 02:04 PM
That sounds good in theory, MarkVB6, but in practice, the program is going through a cycle of hundreds of lines of code many times a second. It would be near impossible to hit a key and capture the exact line of code where a glitch occurred.

However, if you do see a glitch, please post here with a description of what went wrong. That is much more helpful to me.

Also, about the infinite acceleration--yes, you're right. In true space, where there is only microscopic drag, you could theoretically accelerate for a very long time. However, in this game, if I allow that kind of acceleration, it quickly becomes unviewable and unplayable. So, for fun's sake, I break the laws of physics. :)

Machaira
08-29-2002, 02:32 PM
I have yet to see an outer space game that fully follows the laws of physics. Probably wouldn't be very fun to play. :)

jsharbour
08-29-2002, 04:25 PM
Originally posted by Teric
Question--why did you put collision detection code into the sprite class itself? Is there some advantage to doing it that way? It makes more sense to me to put collision detection in the objects themselves, or have a general collision detection routing that operates on objects.

Because my game loops always iterate through the "active" sprites and perform collision detection on each other. It's just nice to have the collision detection code built into the sprite so all you do is pass another sprite to the collision function and it uses the internal variables within the sprite. This makes the collision function easier to use (and with fewer parameters).

Here's an example:

For n = 0 To NUMSPRITES
With csShapes(n)
.X = .X + .SpeedX
'code clipped--check bounds

.Y = .Y + .SpeedY
'code clipped--check bounds

'check for sprite collisions
For lSprite = 0 To NUMSPRITES

'ignore self
If lSprite <> n Then
'check collision
If .Collided(csShapes(lSprite)) Then

'sprites collided--do something

End If
End If
Next lSprite

'increment the frame
.NextFrame

End With
Next n


There you see how easy it is to do collision detection just by calling .Collided()? You pass the sprite variable to .Collided (at which point you would react to the collision).

Of course, for the Sectors game, you might want to just use your existing collision routines and grab the X, Y, Width, and Height of the sprite from the class. If you want a complete example, I just posted up the sources for Warbirds on another thread. That game does a lot of collision checking and even checks to see if objects are visible on the screen, which speeds it up a little.

Jonathan

jsharbour
08-29-2002, 04:41 PM
Originally posted by Machaira
I have yet to see an outer space game that fully follows the laws of physics. Probably wouldn't be very fun to play. :)

Mach, there are a lot of games that simulate zero-drag in space. My DirectDraw game called Stellar War uses gravitic propulsion to realistically move ships based on a certain mass. You have to really hold down the thrusters to see the ship painstakenly speed up. Plus there are black holes that will drag at your ship.

You can actually get into an orbit around a black hole (which could easily be a planet or star if you prefer). By adding gravity to the game it really makes it interesting. For instance, if you thrust in one direction for a while, the ship will start going really fast. Then if you twist the ship around and apply reverse thrust, it takes a long time to slow down.

Here's my generic reusable gravity sub along with the constants and struct:


'gravity constants
Const BLACKHOLEMASS As Double = 0.3
Const GRAVITYWELL As Double = 0.5
Const MASSADD As Double = 0.01
Const MAXMASS As Double = 0.1
Const MAXVELOCITY As Long = 1
Const MAXACCEL As Double = 0.05

'gravity struct
Private Type MASS_OBJECT
mass As Double
X As Double
Y As Double
ax As Double
ay As Double
vx As Double
vy As Double
End Type

Private Sub Gravity(ByRef obj1 As MASS_OBJECT, _
ByRef obj2 As MASS_OBJECT)
Dim distX As Double
Dim distY As Double
Dim dist As Double
Dim distance As Double

With obj1
'move object based on velocity
.X = .X + .vx
.Y = .Y + .vy

'calc distance
distX = .X - obj2.X
distY = .Y - obj2.Y

'distance formula
dist = distX * distX + distY * distY

'avoid division by zero
If dist <> 0 Then
distance = 1 / dist
Else
distance = 0
End If

'calc acceleration based on distance
.ax = -1 * obj2.mass * distX * distance
.ay = -1 * obj2.mass * distY * distance

'limit acceleration
If .ax > MAXACCEL Then .ax = MAXACCEL
If .ay > MAXACCEL Then .ay = MAXACCEL

'calc velocity based on acceleration
.vx = .vx + .ax
.vy = .vy + .ay

'limit velocity
If .vx > MAXVELOCITY Then .vx = MAXVELOCITY
If .vx < -MAXVELOCITY Then .vx = -MAXVELOCITY
If .vy > MAXVELOCITY Then .vy = MAXVELOCITY
If .vy < -MAXVELOCITY Then .vy = -MAXVELOCITY
End With
End Sub




You just call Gravity() with two objects, and it will modify the position of those objects in relation to each other, based on their velocity and mass.

Jonathan

Machaira
08-29-2002, 05:19 PM
I wasn't talking about that as much as the unrealistic movement of ships. From what little I know, ships in games don't move like their real life counterparts (real ships don't rotate immediately, turn on a dime, etc.) . Perhaps I'm mistaken (wouldn't be the first time :D) but I've always been under the impression that ships are very slow and clumsy in space.

BillSoo
08-29-2002, 05:50 PM
Depends on the size....

The player ship in sectors has 24 frames. The framerate is probably around 24fps as well, depending on your computer of course, so lets say that the ship does a complete rotation in 1 second.

The formula for centripetal acceleration is
a = 4*PI^2*R/T^2
Since T is 1 second and PI is a constant, this simplifies to:

a = 39.478 * R

If the ship is about the size of a fighter plane (an F-15 is about 20 metres long), then

a = 39.478 * 10 = 394.78 m/(s*s) or roughly 40Gs.

If the ship is about the size of a small warship (a Spruance class destroyer is 173 metres long) then

a = 39.478 * 86.5 = 3414.9 m/s2 or roughly 350G

If the ship is about the size of a large warship (the Carl Vinson aircraft carrier is 336 metres long) then

a = 39.478 * 168 = 6632 m/s2 or roughly 677G

So presumably, the player ship is either very small, or it is built very strong, or it has some kind of inertial dampening....

MarkVB6
08-29-2002, 09:01 PM
...or else the pilot would be reduced to a quivering blob of pink goo. I get the picture.

I know that the game will never follow the full rules of physics, because a high action game doesn't need to. I wasn't calling it a flaw, just something I noticed. And I suggested that you do not change it.

Teric I've been getting error messages (not handled) at random times. It was all the same message, but I didn't take particular notice of it, I had already restarted the program and was blasting away aliens again! :)

If I see the message again, I'll take a look at the following:

the line of code that it involves
relevant variable values at that time
error message of course
ship's relation to sector parameters (could be an error from going offscreen)

aaa
08-29-2002, 10:53 PM
i reakon u should get rid of the brakes
they really make the game lose the feel of a space game

just have rotate left/right and thrust

so u have to turn and thrust the other way to slow

Teric
08-30-2002, 08:55 AM
You may be right--brakes don't seem to make much sense in space, since there is no friction.

On the other hand, if the ship is equipped with 'braking thrusters', then it does make sense.

How does everyone feel about the 'Space Brakes' equipped on the player's ship? Good? Bad? Keep/Eliminate?

Iceplug
08-30-2002, 08:59 AM
Actually, I'm a little more accustomed to the reverse thrust idea (so that the down button actually works the opposite of the up button, moving the ship backwards, but facing forward), but the Space Brakes concept is okay (to me).

Genzo
08-30-2002, 12:18 PM
I think you should allow an upgrade latter that will allow you to reverse or a space brake not on the same upgrade though different ones, that way you make most people happy.

and get the best of both.

BillSoo
08-30-2002, 12:23 PM
If you don't like the Space Brake (tm) then don't use it.

Incidentally, the problem with viewing the Space Brake as reverse thrusters is that they don't actually move the ship backwards. They merely stop the ship. In fact, I think they work even if the ship is moving backwards itself....

I normally use turn and burn when in combat, however, if I'm trying to collect ore, the extra control provided by the space brake is appreciated.

Teric
08-30-2002, 03:15 PM
Cool idea, Genzo! Thanks.

Genzo
08-30-2002, 03:31 PM
You could add a way where you could make your own spaceship.

example, you could start of in a junk jard where you would build your own space ship out of spare parts then upgrade in different areas latter, like i was talking about in my last post.

MarkVB6
08-30-2002, 04:09 PM
Run-time Error '438'
Object doesn't support this property or method

Case BENEFIT_METAL:
gText.AddTimedText mvarResAmount & " Metal Ore", 3, mvarX, mvarY, 1500
Hitter.LoadMET = Hitter.LoadMET + mvarResAmount 'this is the errorous line!

Case BENEFIT_PRECIOUS:
gText.AddTimedText mvarResAmount & " Precious Ore", 3, mvarX, mvarY, 1500
Hitter.LoadPRE = Hitter.LoadPRE + mvarResAmount

mvarResAmount = 2

I'm gonna leave VB up and the debugger on so that you can poke me with questions if you need.

Mark

MarkVB6
08-30-2002, 04:51 PM
Sorry I accidently closed VB without thinking...so I'll post here again when I have the message.

Teric
09-03-2002, 12:10 PM
MarkVB6:

Found the error that you described above. It happens when a starbase drifts across a floating resource and attempts to 'pick it up'. I've fixed the bug--thanks for pointing it out.

Jonathan:

I've discovered a small problem with your clsSprite class. If I understand correctly, it assumes that black is the transparent color in the base bitmap. However, that eliminates the color black from the entire sprite, even if some black is desired.

Do you mind if I modify your clsSprite class a bit to allow for different transparent colors? (I commonly use 255,0,255 for my transparent color.) I'd like to set it so that the upper left pixel in a bitmap becomes the transparent color--that way, any color could be used, as long as the artist makes sure to put that color in the upper left corner.

Iceplug
09-03-2002, 04:24 PM
BTW, how about moving the control onto the numpad, so that the 5 key does the space brakes and the 2 {down} key does the reverse thrust?
Too much of a change? Maybe it can be done along with the old keycodes and you could just keep all of them in the procedure?

wyrd
09-03-2002, 07:18 PM
Or better yet.. an option that allows us to customize the keyboard controls. :)

jsharbour
09-04-2002, 07:18 PM
Originally posted by Teric
MarkVB6:
I've discovered a small problem with your clsSprite class. If I understand correctly, it assumes that black is the transparent color in the base bitmap. However, that eliminates the color black from the entire sprite, even if some black is desired.

Do you mind if I modify your clsSprite class a bit to allow for different transparent colors? (I commonly use 255,0,255 for my transparent color.) I'd like to set it so that the upper left pixel in a bitmap becomes the transparent color--that way, any color could be used, as long as the artist makes sure to put that color in the upper left corner.


Of course not, do what you want with it, just don't distribute any new copies of it online. The black transparency is not a problem, because you can use any color that is close to black in your image without any problem. Try (1,1,1) for instance. But I know what you mean, bright pink is growing on me too. It's easy to see the borders that way.

Jonathan

Genzo
09-26-2002, 06:53 AM
I thought post to see how you are getting on Teric with sectors.
Or have you just put it to one side for alittle while?
because there has not been any updates for a while.

I hope you are keeping up the good work because I think this game will go far.

Have you thought about geting a team together with people of the board?

dddude55
09-26-2002, 09:01 AM
this game has had a lot of progress just to stop being posted, common it's almost been a month. What kind of updates do you have?

Teric
09-27-2002, 03:33 PM
Forgive me, everyone. I was laid off from my job last week, and I am now busily searching for a new job.

I really do want to finish Sectors--I love the game, and I want to see it completed. Unfortunately, I have a higher priority right now.

By the by, if anyone has a reference for a programming job (in the Gaming Industry, if possible!), please pass it on. jrw2@email.byu.edu

Thanks!

Genzo
09-27-2002, 03:48 PM
I sorry to hear that you have lost your job.
Some one like you should be able to get a good job no prob.
Hope you get one soon.

dddude55
09-28-2002, 06:43 PM
sorry to here man, my dad lost his job a while ago(September 20th), and got a job not to long ago. hope u get one before that length of period. by the way, we live in texas but are canadian so maybe that had something to do with it taking that long. anyway, best of luck!

Tuskony
09-28-2002, 06:56 PM
That's a really good game. Runs a bit slow on my comp when I'm shooting, but other then that, it's pretty cool.

The only thing I'd suggest is that you fix up the AI. Currently(As you know), all the ships just follow yours and try and kill you. It'd be cool if they came in waves, or cooridnated attacks on you. Something like that would be sweet.

artemiegorov
01-02-2003, 03:15 AM
Nice Game!

May I ask ? Where did you make graphics?

Teric
01-07-2003, 10:29 AM
Graphics were built in Blender 2.23, and exported to bitmaps.

I am now using 3D Studio Max 5, and I wanted to post a test of the new Sectors model, to see what everybody thinks.

Squirm
01-07-2003, 11:44 AM
Dude that's awesome. Glad to hear you're still working on it. :D

Seanami
01-07-2003, 05:28 PM
I agree, that ship looks really great. I am eagerly awaiting a post of your most recent version. :)

Iceplug
01-07-2003, 06:51 PM
Ooh... nice ship. Did I overhear you mention before that there would be a Sectors 3D?

Nerseus
01-07-2003, 09:15 PM
lol - this ONE topic has almost twice as many VIEWS as the whole DirectX forum :)

Good game, btw (don't think I ever said it).

-Nerseus

Kuno
01-07-2003, 10:28 PM
Yeah, This game rocks! Keep up the good work Teric!!

Kuno

Teric
01-08-2003, 10:46 AM
No 3D Sectors yet, but I plan to switch to Direct3D for the graphics. I have found that, once you learn how to use Direct3D, 2D graphics capabilities seem somewhat limited.

jsharbour
01-10-2003, 12:50 PM
Teric, are you talking about D3D8 or D3D7? Because D3D8 is far more powerful at doing 2D than DirectDraw ever was. Are you just using a D3D surface as a sprite, or using a D3DXSprite object? Be sure to check out the D3DX lib for a bunch of useful functions. The cool thing about it is that you can add 3D effects to an otherwise 2D game.

Regards,
Jonathan

CrazyWoman
01-13-2003, 05:44 PM
Hey Teric, I was wondering if I could try to create my own Sectors game, with your graphics. It probally won't be a full blown game, but just something I can work on to pass the time. :D

If you want to see what I have so far, tell me and I can upload it for your viewing pleasure. ;)

Nerminator
01-14-2003, 05:06 PM
Teric, awesome game but I was just wondering how you can have the 800 enemys with no slowdown. You dont seem to have used an array. Thats the only way I could think of but my game slows down after two units.

Nerminator
01-14-2003, 05:44 PM
Just a small bug:

Public Property Let TurnSpeedLevel(ByVal vdata As Long)
If vdata > MAX_TURN_SPEED_LEVEL Then Exit Sub
If vdata <= 0 Then Exit Sub

Should be Exit Property not sub.

Public Property Let TurnSpeedLevel(ByVal vdata As Long)
If vdata > MAX_TURN_SPEED_LEVEL Then Exit Property
If vdata <= 0 Then Exit Property

Teric
01-15-2003, 02:07 PM
Right you are, Nerminator. Thanks for bringing that to my attention.

JSHarbour--I plan to use full Direct3D (In DirectX8) for Sectors. That way, I can use full 3D models, which allow me a much better range of motion than simple 2D sprites. (Geez, you work in a game programming company for a few months, and you learn a ton!) Hm... guess that means this thread may be moved to the DX forum.

Here is a screen shot of the new UFO enemy:

chris00
01-15-2003, 02:54 PM
Looks good Teric :) :D :cool:


BTW: How is the job going ?

Teric
01-15-2003, 03:32 PM
I love working here. I'm learning so much about game programming!

I'm also learning the value of low polygon counts for 3D models. This means that you don't want to use a high amount of triangles to make up your 3D models; otherwise, your game will get bogged down rendering complicated models.

Thus, regretfully, the pic of the main ship that I posted before won't be what it looks like in the final game. I checked the polygon count of that model, and it came out to be over 4000!

I'm using a new model now, one that has about 1200 polygons.

Nerminator
01-16-2003, 02:51 AM
May I ask how you worked the moving of al the ships without slowdown. I've tryed looking at the code but cant figure out where it is. I use an array. Is there a better way than that. Thx for any feedback

Pookie
01-16-2003, 09:11 AM
Wow, Teric is still alive.... :)

Nerminator
01-16-2003, 08:37 PM
btw another small bug

it doesnt always happen but in powerup.cls:


Case BENEFIT_METAL:
gText.AddTimedText mvarResAmount & " Metal Ore", 3, mvarX, mvarY, 1500

Hitter.LoadMET = Hitter.LoadMET + mvarResAmount


on the hitter line it says

object doesnt suppot this property or method

Teric
01-27-2003, 01:15 PM
Yep, still alive. Busy with a new project at work, but I wanted to check in.

Teric
01-29-2003, 09:07 AM
Ok, everybody--I've been busily designing models for Sectors, and I'm trying to cut down on the polygon count so that I can achieve a good framerate. Attached below is a graphics test that I'd like people to help out with, if you would.

When you run the test program below, you should see three spinning models: asteroid, main ship, and green enemy. Hit the F key and a FPS monitor should come up. I'm getting 50-60 frames per second here at work, which is pretty nice. Please let me know if any of you get a frame rate of less than 35. Thanks!

CrazyWoman
01-29-2003, 11:14 AM
On my computer here at home, it runs at ~75 FPS

Edit: Disabled VSync and it jumped up to ~150

I'm running on a WinXP Machine, 1.0Ghz, 256Mb RAM, and a Voodoo 5500 PCI

On your earlier version of Sectors, you could have many ships at the same time on screen, more ships means more rendering power needed. If you keep adding ships you might experience a slowdown of FPS, In order to keep it running smoothly, you could lower poly counts of each model, or you could implement some algorithm to change the LOD (Level of Detail) of the models (say have a high-poly version and a low-poly one, draw the low-poly when there are lots of ships) according to how many things are being drawn on the screen at once.

Just my advice ;)

excaliber
01-29-2003, 12:06 PM
I'm running at ~17 FPS...

maybe its just my crappy comp.

Heres the specs:

Win 2000 proffesional
400 MGhz
192 RAM
3D Rage Pro AGP 2X from ATI

Gamer X
01-29-2003, 12:37 PM
I get 11fps, but like Excaliber, it's due to a more-outdated-than-last-month computer.
462.82MHz Celeron Processor
~300MB SDRAM
8MB nVidia TNT2
Looks great though, keep up the good work!

Arigato,
Gamer X

RabidChimp
01-29-2003, 12:55 PM
Well im running it on my sisters computer since mine is experiencing technical problems. Its runs at around 16 FPS

System Specs : 733 Mhz, 256 Ram, Win XP, 16mb TNT2

edit* i tried what Seanami did (leaving it on for a while), and it did pick up. It climbed upto 54-55 FPS

Seanami
01-29-2003, 01:22 PM
I'm on a school computer right now. Running the program out of the IDE. At first it was running really slow, around the teens to low 20's in FPS, but after I left it running for about a minute or so it sped up and eventually I got a constant FPS of around 52 FPS. Very nice, the models look really good! Here's the computer specs:

Pentium III 500 MHz
128 Mb RAM
8 MB Rage Pro
Win 98

52 FPS isn't a bad framerate for such a piece of junk computer!

Teric
01-29-2003, 02:07 PM
Good information, folks. Thanks.

AtonalPanic
01-29-2003, 02:19 PM
I got 105 fps and I tested compatibility options win xp let me, and it worked great.

Specs:
win xp
2ghz+ athlon
radeon 9000 pro - 128mb
512 ddr memory

Garmour
01-29-2003, 03:09 PM
Sorry Teric, just got a yellow bar for the fps
but it looked nice and smooth if that helps.
Nice models

Seanami
01-29-2003, 05:56 PM
Wow. Even better news. I ran it on my home computer and got 120 FPS, and it loaded very quickly too. Specs:

Pentium III 550
384 MB RAM
32 MB NVIDIA TNT2 Pro
Windows 98

AtonalPanic
01-29-2003, 06:43 PM
Teric one thing, I got a aim message while the program was running and a auto mation error came up. It's pretty easy to fix, I just thought I'd let u know. I also was able to change my gfx card from quality to performance, and I got 300+ fps see...

AtonalPanic
01-29-2003, 06:47 PM
sorry bout making a new post, I forgot to attach

JimCamel
01-29-2003, 07:38 PM
Windows .Net 2003 RC1
256mb SDRam
650mhz AMD Duron
Voodoo 3 2000

Overall a pretty crappy computer, but still got 60fps on it.
Althought when I try to run it with full compile I get an error
"Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic"
in class module CMesh, Function LoadFromDXFileData, line, " pAdj = mAdjBuffer.GetBufferPointer"

Overall looks sweet though

Teric
02-05-2003, 03:52 PM
Ok, I've implemented some movement through space.

Currently, the main ship is tumbling through space, without power. This is just to give you an idea of what actual flying through space will look like. Please take a look, and don't forget to hit that F key and report what your frame rate is.

Enjoy!

excaliber
02-05-2003, 04:09 PM
looks great!

I'm only gettnig 20-30 FPS, but once again my crappy comp comes into play.

Cant wait to see the finished project!

AtonalPanic
02-05-2003, 04:54 PM
Nice I get about 260 fps, but there should be a bit more stars.

Seanami
02-05-2003, 05:36 PM
I'm getting around 82 FPS on my home computer:
Pentium III 550
384 MB RAM
32 MB NVIDIA TNT2 Pro
Windows 98

I agree with atonal about the stars...

crazycheetah
02-05-2003, 05:44 PM
Nice!

only problem is that i got ~12-18 FPS... but my comp sucks so i'm not suprised at all:
AMD K6/2 400MHz
ATI Radeon 7000 (PCI)
256MB RAM (normal useage with only my regular apps running is 224MB (87.5%))

still, it's pretty nice... after the ~1-2 min period of blackness, lol... keep up the good work Teric :D

RabidChimp
02-05-2003, 06:32 PM
Very Cool :D

I get about 60-61 FPS on a Pentium III 733
16Mb Graphics Card

Can't wait to see the next update

grandlouis
02-06-2003, 12:37 PM
70 fps on XP 2000+ and Radeon 9000 :-)

Makkers
02-06-2003, 03:19 PM
Hmmm, I got 61 fps. XP1800+ (1.54G)mhz, 256DDR and using a GForce4 (Not true Nvidia). Windows XP(Home).

I guess my mates right , Radeons are the way forward

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum