Sorry your browser is not supported!

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

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

DarkBASIC Discussion / DarkPro's - What do you think?

Author
Message
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Mar 2010 23:04 Edited at: 16th Mar 2010 23:48
Quote: "I'd be interested in hearing any ideas on why the player would stay on the grounds instead of just running away."


How about it all taking place during a very bad storm. As he's driving (just before running out of petrol), the rain starts to get heavier and he hears thunder looming ominously close. He notices the river at the side of the road is flowing faster and is rapidly rising.

When he actually does run out of petrol, a real gale is blowing and trees are coming down around him - he needs shelter quick! His mobile is not working as the storm has brought power lines down.

As he crosses an old wooden bridge, hoping to find a farmhouse with a working phone, he is thrown to the ground as a flash of lightning takes out the old bridge.

It's the only way onto the property and the river is too violent to cross without it. The only option is to wait until the storm is over, the power lines have been fixed and his mobile phone works.

Phew!...

I'll work on those models for you.

[Edit]: Not sure whether you wanted an old decaying couch or just an old one. As I assume the lower the poly count the better, this one I just did is 25:


Download Here

I'm sure I have others hidden away somewhere - I'll see if I can dig them out...

[Edit 2]: Doh... Just read your post and you did say what sort of couch. Onto it now...

TDK

No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 17th Mar 2010 00:08
@All
Quote: "* Tasks yet to be started and assigned
1. Health system - both player and monster
2. Saving - Loading game system
3. Scoring"

We also need a combat system. I think Latch has the projectile portion down but we'll need a hand-to-hand combat system as well.

@TDK
Quote: "How about it all taking place during a very bad storm. "

I like the storyline, just don't as me to animate it!

The couch looks good for only 25 polys! Just need to deacay it a bit.
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 17th Mar 2010 02:51 Edited at: 17th Mar 2010 14:42
@TDK
I count more than 60 polys.
Why did you extrude the pillows like that? Each pillow has 10 polys (4 sides, 1 top) you can easily reduce that to about 6 or 4
A low poly couch has its pillows mapped in it's texture, not in it geometry.

@pictionaryjr
Nice armoire. You can save 8 polys by removing the back. 4 by removing the horizontal polys.
Another 4 if you detach the base, however this you require a little trick to texture it. And another 8 polys if you would alpha map the front of the base.

Anyway, I tried a quicky in blender because I'm bored and I'm sick atm. I hope you like it. (64 poly)


Attachments

Login to view attachments
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Mar 2010 03:40 Edited at: 17th Mar 2010 17:26
Quote: "I count more than 60 polys"


I mistakenly said 25 polys when I should have said 25 faces (it has 40 vertices). At two polys per face that's 50 polys right?

Having said that, you've obviously loaded the .X file from the zip and Truespace might possibly have triangulated the object when saving it. I'll have to check that and turn it off if it has.

Here's what I was looking at when I saved it:



The question is, what is everyone classing as 'low-poly'?

I've done another one, but I'm going to have to scrap it if 60 polys is too many as it's way over that figure.

[Edit] Scrapped it! Lol...

TDK

Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 17th Mar 2010 03:58 Edited at: 17th Mar 2010 04:12
http://en.wikipedia.org/wiki/Low_poly

your model has 62 polys
10 per pillow, 14 around that, 6 on top, 6 on front, 2 on back, sides and bottom.
It's a real easy fix, just remove the pillows, raise the remaining surface and paint the pillows on the texture.

Here's an ammocrate

it's based on this. Should be an easy texture.
It's 92 polys right now, but it's not finished.
I'm going to add small boxes of ammo inside the chest, since I'd imagine ammo comes in cardboard boxes

Attachments

Login to view attachments
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 17th Mar 2010 07:33
Here's a couch that I made that is 28 pollies and doesnt look too different from yours.



Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Mar 2010 18:24 Edited at: 17th Mar 2010 20:35
Quote: "The question is, what is everyone classing as 'low-poly'?"

This is subjective. I think the way to answer it is, make the best
looking (realistic) model as possible with as few polygons as
possible allowing the texture(s) to handle the details. For most
square or rectangular shaped inorganics, I think less than 100
polygons is reasonable. And by polygon, I mean triangle. Many 3d
apps default face configuration is quads. If the count of faces is
in quads, then that will be half of the true count that will be in
DBC.

For this particular project, try and think of it in terms of a
house and how many of a particular item may be required.

A wooden chair, for example, might have 4 to 10 instances in a
house. Maybe an average of 6. So if you guess at about 6 chairs
and the polygon count for each is 500, that's 3,000 polygons.
That's just too many.

A real killer of performance, though, is textures. If you have a
12 polygon cube, but you tile the texture on each side 4x4, DBC is
going to have to do more work to map the texture.

What does all this mean? Well, if you can output your object to
directx, load many copies of it into DBC and check the
performance. You can check the number of polygons DBC is counting
by using:

text 0,0,"Polygons = "+str$(statistic(1))

Check the FPS and and the polygon count as you add or remove
objects. How much FPS is being eaten up by adding a certain number
of objects. A drop in 10 fps by adding 1 object is a pretty big
hit for example. The whole process is a touch feel kind of thing.

Again, the goal is good-looking, as realistic as one can manage,
models that have as few polygons as possible. We'll just have to
take it from there.

Enjoy your day.
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 17th Mar 2010 18:43 Edited at: 17th Mar 2010 18:51
Here's the current progress on the crate.
Please not that it has a hi-res texture at the moment, I'll reduce it when it's done.
It has 64 faces.

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Mar 2010 20:38
looking good! Wow, you guys are turning out models at a pretty high rate.

Enjoy your day.
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 17th Mar 2010 21:55 Edited at: 17th Mar 2010 22:07
thank you ^_^

Here's a shot of the inside. I really like it so I'll share it while it's still hi-res

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Mar 2010 23:43
Quote: "As he crosses an old wooden bridge, hoping to find a farmhouse with a working phone, he is thrown to the ground as a flash of lightning takes out the old bridge.

It's the only way onto the property and the river is too violent to cross without it. The only option is to wait until the storm is over, the power lines have been fixed and his mobile phone works."

I like the idea! It may a kinda tricky to pull off, but it helps explain a few things.

Here's my first attempt at getting a physics animation of an exploding bridge (attached). With some tweaking and texturing and a little bit of redesign, it may just be doable without having to code the physics in DBC:

Enjoy your day.

Attachments

Login to view attachments
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 18th Mar 2010 14:23
Quote: "as a flash of lightning takes out the old bridge"

We could light it on fire as an alternative.
But seeing your animation, I don't think we have to

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Mar 2010 21:12
Quote: "We could light it on fire as an alternative."

That's not a bad idea. I am going to try a couple of different animation methods. Even some generic particle explosion code similar to the DBC examples. Instead of a fixed animation, the limbs of the bridge can be randomly positioned and rotated over time with code.

@all
I've been pretty busy lately so I haven't had any time to work on anything. Hopefully, time should free up with in the next week or two. No Time to Code is also on vacation/holiday this week.

@Link102
That ammo box looks excellent!

Enjoy your day.
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 26th Mar 2010 10:02
I don't wish to be annoying, nor a spammer.
But I think a lot of people agree with me if I say

*** bump ***

keep this topic alive.

(more updates soon)

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Mar 2010 16:18 Edited at: 26th Mar 2010 16:35
Not bad picty
I would put some handles on there so it's not completely flat.

@Link
Very nice texture, it looks a bit light though.

@All
I'm learning how to model. Is there a list of all the models you'd like?

I posted an alternative storyline a few pages back and no one has commented on it. Maybe I went into too much detail
Basically, instead of running out of gas, I thought a more feasible story would be that they had a car accident near the farm. Maybe an animal (possibly alien) darted out in front of them and they swerved into a ditch.

As for the scene, was the farm abandoned or was it attacked by the aliens?
Are there going to be dead animals and even a dead farmer or just an empty farm? How long ago was the farm attacked/abandoned? Have the bodies decomposed? Is everything dusty and mouldy? What country is this set in?

I think the farm being attacked would explain why there are still weapons lying around, but then we would have to make dead bodies

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 26th Mar 2010 17:10 Edited at: 26th Mar 2010 17:25
Latch posted a list above pictionaryjr's armoire post.

about the texture brightness, it's at 100% ambient. It should be darker when loaded into dark basic. But we can always change the brightness.

About the story, I like the car crashing, though it is a bit of a challenge to animate.
The farm was abandoned while it was attacked how's that? The body lies somewhere in the field. Would be funny to have a blood trail leading there.

Right now I'm trying to get the offset of the gun to the camera, but I can't get this simple 2d (xrot,yrot) rotation done. It's like it's treating the rotations as world rotations.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Mar 2010 23:50 Edited at: 26th Mar 2010 23:57
Quote: "I'd be interested in hearing any ideas on why the player would stay on the grounds instead of just running away."

I can think of four types of reasons for staying
A. Something physically stopping you: aliens surrounding the grounds or you somehow become trapped inside the house.
B. An emotional reason for not leaving: someone else is trapped or injured and you don't want to leave them to die.
C. Duty: you can't leave because YOU must stop them.
D. Self sacrifice or hopelessness: there is no escape or you are infected and will die/turn into an alien and cannot be cured. You decide to go out guns blazing!

Let's look in a bit more detail at these options.

A: Trapped
A physical barrier is the most obvious, but what would that be?
An impenetrable ring of aliens suddenly appearing is hard to explain and trees or power-lines falling down and blocking your path is very coincidental. Or maybe the reason is simply that he doesn't want to risk running from the aliens and thinks it is safer inside.

B: The Protector
Maybe there was someone else in the car with you when it crashed. They are badly injured and you carry them to the farmhouse.
Alternatively you could discover someone at the farmhouse who is still alive but is badly injured. In both cases some extra modelling and animation is required, maybe even voice acting.

C: Duty
I can't think of how we could use the "duty" reason because it suggests hunting down the aliens and exterminating them, which involves too much moving around.

D: Hopelessness
There is no more detail to add, you simply accept that you're going to die and try to kill as many as you can.

- Summary -
Personally I think the simple fact that there are loads of aliens outside is good enough reason to stay but maybe what I have written will spark someone else's imagination.

_____

Now what about those aliens?
Why are they attacking this farm?
Farms are quiet and isolated, so the aliens must be keeping a low profile.
Why would they do that? They obviously like killing people so why not attack a city?
They obviously aren't capable of taking over a city.
So they are either here by accident or they are preparing for a larger attack.
If they are here by accident why would they attack humans? Let's leave that one for now and assume they are planning a bigger attack.

So, they are attacking the humans to improve in some way. Maybe they lay eggs in humans or infect humans so that they turn into aliens, both effective ways of raising their numbers (and both champion the "hopelessness" reason for staying). Humans could simply be food for the aliens or their technology requires living organs to power it or some other creepy thing like that.

- Summary -
I like the idea of an infection that slowly turns the protagonist into an alien. It offers a few game mechanics: there could be a bar that tracks how far you are into the transformation, receiving damage from the aliens could speed up the process. There could also be an eerie option of suicide which would score you bonus points if you killed yourself before you completely turned into an alien.

Hope this helps.

[edit]
BTW I am attempting to make a bucket, it might take me a while as I am learning Blender as I go.

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 29th Mar 2010 02:00 Edited at: 29th Mar 2010 03:27
@Latch - I'm sorry for my recent absence as of late, I had ran into a modeling and texturing block from prolonged fiddling with the crate. After a break, I started trying to get the crate to work again. My largest problem was the fact that I could generate an acceptable wood texture, but I haven't been able to create a normal or bump map from it. I use Texture Maker, and it allows for the creation of both my wood texture as well as bump maps, but for the life of me I didn't know how to get a bump map of the wood texture that I wanted, then I found the 'randomize seed' dialogue box, and from there I could make a texture and a bump map that matched. Then, I used x-normal to translate it into a normal map. When applied to a normal cube, it now does really look like it has been properly mapped. I'm going to work on a full crate now, it should be done soon.

EDIT: I sort of got it, I don't think that I'll be able to take a snapshot and map it onto a plain cube, though. I have studying to do for a FBLA state competition, so I'll try to work on it some more tomorrow or Tuesday.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Mar 2010 04:34
I've just found a nice effect we could use for the menus.
http://www.smart-kit.com/games/shipwrecked/
No I'm not suggesting pictures of pirates but I like the way that when you move the cursor towards a picture it moves to meet you.
Great for lazy gamers who can't be bothered to move the whole way

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 30th Mar 2010 05:40
@OBese87
I was going to use that effect if I went with sprites as menu buttons. Just stretch the sprite if in collision with hidden sprite at mouse position. Because of the problems I mentioned earlier in the thread (fatal errors when deleting sprites) and the possible slowdown from mixing 2D and 3D I'm going with textured plains and checking for mouse position. I think in this case it might be more trouble than it's worth to check position against expanding/contracting objects. As it is I'm just changing the text color when the mouse is over the button. Still look pretty good.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Mar 2010 06:27
@Digger412
That's fine. In order to get the environment to what I considered a useable state where I could test the collision mapping and such with different shapes, in the interim I made a few crates to use, so feel free to continue working on that or not.

@all
I'm working on a couple of file routines to manage media and other files used in the game as I have time. I'll try and post an exe of a walkable environment within the next week or so. It may be a slimmed down version in terms of textures and such to keep the download size small - so the detail may be a bit less - especially the ground.

I'll also try and get a posting of the alien walking - probably before the environment since I've got that part of it's animation done. Again, I'll probably reduce the texture size to save download time and space.

Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Apr 2010 03:47
dblepost - oh well...

Here is a look at the first draft of alien walking animation. Press SPACE if the performance is too slow to turn off reflections. This uses a texture of 256x256 instead of it's real texture of 1024x1024. In game, the texture will probably be 256 or maybe 512 so it will look similar - though I plan to correct a couple of oddities for 256 that don't show up at 1024. Download attached

Enjoy your day.

Attachments

Login to view attachments
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 1st Apr 2010 04:21 Edited at: 1st Apr 2010 04:21
Excellent work Latch! (and under schedule too )
I had some funky music playing in the background which made it even better.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Apr 2010 05:07
Thanks! Speaking of funky music, the Alien and a couple of it's buddies wanted to prove that they weren't all claws and malice. They cranked up the Alien Saucer's radio (which plays very limited music by the way), and one of them decided to try break dancing.

The more I watch it looks less like breaking and more like Capoeira. Have these Aliens been to Brazil?

Download attached

Enjoy your day.

Attachments

Login to view attachments
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 1st Apr 2010 06:19
HAHAHA!

Definitely more like Capoeira. Maybe we should have this playing during the end credits of the game.

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st Apr 2010 16:34
Latch:
The reflection is cool. Nice work.

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Apr 2010 03:12
Thanks!

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Apr 2010 14:09
LOL, That dance was hilarious! Guess I peaked in at the perfect time!

TheComet

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Apr 2010 02:53
Thanks!

And here's pictionaryjr's Armoire textured and ready to be used. Extract everything to the same folder and run "arm_code.exe" for fun.

Download attached

Enjoy your day.

Attachments

Login to view attachments
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 3rd Apr 2010 02:54
@Latch - I finished with the new crate. In 3DC, it looks great (I have a screenie in the .zip), but when I loaded it into DBP it seemed to lose a lot of the detail that it had before. The .zip is uploaded to the MediaFire account. I was also wondering where all of the stuff in the repository went, it looked like there was nothing there o?O
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Apr 2010 03:08
@Digger412
No Time to Code and I stopped using it a little while ago. I don't remember deleting everything though. I may have deleted the stuff I put on (though I can't quite remember), but not all of the folders and such. Maybe there is a time limit of inactivity where stuff gets removed by mediafire when you don't have a paid account.

Enjoy your day.
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 3rd Apr 2010 03:11
@Latch - No, there isn't a time limit because I've left stuff I have on another account alone for months at a time. I'll upload what I have to here.

Attachments

Login to view attachments
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 3rd Apr 2010 17:18
@pictionaryjr
The armoire looks great

@Latch
Nice effect

@Digger412
The screenie looks good, I haven't got a chance to look at the model yet. I didn't delete anything from the repository either. I checked this morning and could't find anything (other then the model you just created). That's pretty screwed up....

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 3rd Apr 2010 18:32
@NTTC & Latch - I was looking in the Support section, here's what it has to say: "There is currently no time limit on how long uploaded files will be stored as long as you access your account (i.e. login to your account) at least once every 60 days OR at least one of your files is accessed (i.e. downloaded) every 30 days. If your account is not accessed within the time limit, then the files in your account will be cleared."

The reason my other files on my other account were not deleted was that I would log in now and again, but I didn't access them, so had considered that 'leaving them alone'.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 5th Apr 2010 11:00
There are no more noobs, we are the last of the DBC users!
This could be the last major project made in DBC, so keep that in mind.
You are doing a great job so far guys, I hope I can contribute in some way.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2010 07:35
Quote: "There are no more noobs, we are the last of the DBC users! "


This is so true! I am even drifting away now... lol c++ and cross-platform has really captured my attention lately.

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Apr 2010 00:03
Eight Hours 'til Dawn

I don't like the going outside business to get weapons/ammo. It adds a huge layer of complication. Although a lot of work has been done on this so far, I'm considering a redesign.

Here are the problems that keep creeping up with going outside and then returning inside:

1. What are the aliens that are already inside supposed to do?

1a. If the aliens pursue the player outside, if the player is clever and has the proper timing, they could lead the aliens out, go around the house, and then back in and have effectively cleared the house of any monsters. If they creatures are following the player back in through the door, the player just waits and shoots them in a nice line one after the other.

1b. If the aliens stay in the house, the player can move around to the windows and shoot the aliens like fish in a barrel.

2. What are the aliens that are ouside supposed to do?

2a. If the aliens leave their current entry points and purse the player, the player could lead them away similarly to item 1a.

2b. If the player returns to the house, do the monsters go back to their original places and attempt entry or do they follow the player in through the door and get shot in a line?

Perhaps, if the aliens are fast enough, and depending on the weapon and the reload/reset time, the line of aliens would catch up to the player thus making it a bad idea to go outside, and also making it a bad idea to pool the aliens in 1 spot - but then again, if they are coming from all directions and are too fast, the player has no chance and the game becomes unfun very quickly.

3. Originally I didn't want the aliens to be able to come in through the door because that is how the player gets outside to get supplies. And if the player can't get out, the game can become unplayable.

3a. If the aliens can come in through the door - is it baricadable? Then how does the player get out?

3b. If the aliens can't come in through the door - does that mean they can't leave through the door either? If they CAN leave, but CAN'T come back in, then the player can clear the house of aliens and scenario 1a comes back into play except this time, the player is safe. Now the player has an unfair advantage and could lead the monsters out of the house whenever they feel like it to make things easy.

4. Trying to sort out the scenarios up above means additional code to try and control as many possible exceptions as there can be.

A lot of the problems would go away if there was just an inside area that the player couldn't leave, and the monsters come in from the ouside through the barricades.

The goal of this project is to get something done that's playable, not overly complicated to code, and is compact (i.e. there is only one goal - survive - arcade style)

Having the outside and inside switching makes the project much larger. It opens up the question "why doesn't the player just run away?" and the answer to that opens up a whole other series of coding and graphical challenges that could be eliminated.

Is there any reason to keep the idea of going outside for supplies?

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 8th Apr 2010 01:56
Quote: "Having the outside and inside switching makes the project much larger. It opens up the question "why doesn't the player just run away?" and the answer to that opens up a whole other series of coding and graphical challenges that could be eliminated."

I totally agree! Although we talked about ways to handle some of the above challenges such as having the aliens in the house duck down when the player exits the house, at this point I think anything we can do to simplify the process and finish the project is the way to go. Some folks have helped out with models (Digger, Link, TDK, etc) but thusfar it's you and me doing the coding. Assuming that doesn't change, it think simplicity is key.

I can start going through the AI code:
1. Remove the patrol alien type
2. Aliens just need to move to a window, enter the house and have the pathfinding kick in. No need to worry about chasing the player outside the house

I've been doing some reading on Finite State Machines (FSM) so maybe once I remove the above code, I can make the remaining code more coherent using FSM.

Everything that was discussed about the backstory can still apply (I like the exploding bridge effect you did! ) If the player can survive till dawn, the aliens leave and the player has won the game.

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Apr 2010 02:27
Quote: "I can start going through the AI code:
1. Remove the patrol alien type
2. Aliens just need to move to a window, enter the house and have the pathfinding kick in. No need to worry about chasing the player outside the house "


Also start thinking of modularizing the alien AI so that it can accept or output a specific input type.

For example:

In most circumstances, the alien is going to be moving forward. So after running the the calculation algorithms that determine if the alien is going to move, the final output will be

forward=1

Now if the case of turning left or right, the ouput would be a y angle for the alien.

yang#=whatever

Now, if I do my part correctly, I'll have functions that accept input either from an alien or a player in terms that all entities share:

fwrd,bckrd,yang#,xang#,lft,rgt etc.

It so happens that I have such functions to do just this - also taking into account an environment set up for static collision, matrix and/or object height detection and various speeds - forward, backward and lateral.

So, in a waypoint system, the determiner for the alien to move will be based on where the next waypoint is. The direction the alien has to turn, it's forward speed, and it's forward command will have to be sent to the gerneric movement function which will calculate the necessary ground heights, collision, and new position of the entity.

In a pathfinding system, it would be similar. The direction the alien has to turn to move to the next path point and such would be fed into the general movement function.

This way, all entity movement (including the player/camera) is controlled through the same mechanism.

Now, by removing the outside element, the house becomes very small... should we leave it, or should we make the house a bit bigger : more rooms?

Also, for the upstairs, perhaps there could be waypoints that instead of leading to a window, lead to a point outside where the alien jumps onto the upstairs porch.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 8th Apr 2010 03:00 Edited at: 8th Apr 2010 14:11
Quote: "This way, all entity movement (including the player/camera) is controlled through the same mechanism."

OK, I understand.

Quote: "Now, by removing the outside element, the house becomes very small... should we leave it, or should we make the house a bit bigger : more rooms?"

I say leave the house as is for now. Changing the house at this point will set us both back in terms of modeling time and pathinfinding coding. The paths are calculated using an algorithm but the placing of nodes and, more importantly, setting up the adjacency matrix (The adjacency matrix is a grid that shows what nodes are reachable from a given node) that is used by the algorithm is somewhat manual. Eventually I would like to create a program using Sparky's to raycast between nodes to determine if they are reachable and automatically create the adjacency matrix. I wrote code to do this in DBP using primitive objects but I couldn't get it to work with your model. It wasn't registering collisions with the house object. Also, we had agreed that this project wouldn't use any outside DLLs. At some point I would like to get this working with complex models and rewrite my A* algorithm to with an adjacency matrix instead of a grid......But for now I fear these side 'projects' would set me back quite a while.

Quote: "Also, for the upstairs, perhaps there could be waypoints that instead of leading to a window, lead to a point outside where the alien jumps onto the upstairs porch."

This should not be a problem. Should be easy to modify the adj matrix since these nodes would only have one connection (the node on the porch)

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Apr 2010 03:20
Quote: "Eventually I would like to create a program using Sparky's to raycast between nodes to determine if they are reachable and automatically create the adjacency matrix."

You can use a variation of the line of sight function I'm using in this project. Instead of testing for static collision areas, change it to an object collision box and have your nodes enclosed in object collision boxes. Set the house to polygon collision collision and test that against another object whose collision is set to boxes (not an object collision box which won't collide with polygons). If the collision with the house is detected at the same point or before the node is detected, the node is not in LOS.

Quote: "At some point I would like to get this working with complex models "

What is a complex model?

Quote: "Also, we had agreed that this project wouldn't use any outside DLLs."

I've been thinking about that. The main reason was so that as a community, everyone could contribute with the same basic DBC tools. Also, it seemed interesting to see what could be pulled off with DBC alone.

Though I'm tempted to want to use DLLs for collision, particles, height calculations, pathfinding, etc. I would like to see this through just using DBC.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 8th Apr 2010 03:31
Quote: "You can use a variation of the line of sight function I'm using in this project."

I'll take a look at that.

Quote: "What is a complex model?"

I meant Sparky's detected collision with cubes, boxes, cylinders, etc but did not work with your house model. It was probably something simple I was missing but I couldn't figure it out at the time.

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 8th Apr 2010 07:15
I would just like to say, Thank you. These posts have taught me A LOT about game planning, team planning, and even coding(even if i haven't seen a lot of code sincei 'm not in the team) In my oppinion even if you aren't on the team this thread is teaching a lot! Keep it up guys! For example,

Latch:
I would never have thought of all those senarios until they made a problem in my game!

No time to code:
Your explanations of path finding and AI have helped me a lot!

those are the most resent i can think of. Like i said, Keep it up!

New Site! Check it out \/
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 9th Apr 2010 00:16 Edited at: 9th Apr 2010 00:17
@Latch
I got your LOS code to work in creating the adjacency matrix and in the process I figured out why Sparky's wasn't working. It was my dumb error in setting the y value for the start and end nodes. I need to compare the resulting matrix with the one I did by hand. The only problem with the automated method is that it's unforgiving. What I mean is, even if the raycast slightly touches a wall, it's stored as "no path". What I need is a raycast that will check whether any part of a 10 unit wide node (sphere object) can "see" any part of another 10 unit wide node. When I created the adj matrix by hand I made the assumption that your sliding collision will allow for successful movement even if the LOS is slightly off. Now, since I never had a working sliding collision on the aliens at the time I was setting this up, that assumption may not have been correct but having seen how it works when the camera moves along it's path during the menu, I'm pretty sure it will be fine. If I go the automated route I may have to create more nodes to ensure a better selection of paths.....

I'm debating whether I want employ a Finite State Machine (FSM) or just tweak the existing code based on our recent forum post. I think the FSM would be easier to implement with DBP because of the global variables and UDTs but I'm willing to give it a shot. As I understand FSM, it will require many more sub/function calls then I'm currently using. I remember you had mentioned cutting down on these calls to improve performance. There is a method that uses CASE and IF-THEN statements with would require less sub/func calls but is only recommended for the simplest of objects because anything more complicated could result in spaghetti code and debug nightmares. Right now this method could work depending how complicated it gets once we add movement through windows and combat to the mix. Right now I figure about six states:

Dead
Outside
AtWindow
Pathfinding
LOS
Combat

But I'm sure this could change once I get into the nuts and bolts of it all....

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Apr 2010 01:23 Edited at: 9th Apr 2010 01:27
I'm a little sceptical about FSM implementation. Isn't that a paradigm for mechanical systems where actions are event driven? While the pressure of tank b > than 98 psi open valve a etc. I suppose it could be applied to a GUI and AI in cases where they would do nothing until activated.

I think our system is AI that is always active. The aliens are always adjusting their position. However, the concept of states is applicable to a degree.

The alien is outside
inside
at window attacking
dead

From what you are writing, it seems that you would be creating another set of parameters to monitor the "states" of the alien when the design of the game is already incorporating these states - at least implictly. Can you explain what advantages your approach may yield?

The more conditions that a are tested, the worse performance gets. It can be negligible, but it should be a consideration. Then again, I'm not sure what you are after.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 9th Apr 2010 03:14 Edited at: 10th Apr 2010 04:44
Quote: "I'm a little skeptical about FSM implementation. Isn't that a paradigm for mechanical systems where actions are event driven? While the pressure of tank b > than 98 psi open valve a etc. I suppose it could be applied to a GUI and AI in cases where they would do nothing until activated."


This link describes an example of the use of FSM in a FPS
http://ai-depot.com/FiniteStateMachines/FSM-Practical.html

Quote: "Can you explain what advantages your approach may yield?"

The current code uses states to some degree but If I do it correctly, I'm hoping this method will formalize and modularize the code allowing for:
1. More logical and easier to read/debug code
2. Ability to more easily add/change behaviors

I'll put together an outline in pseudocode so you can get a better idea of the concept.

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 10th Apr 2010 04:45 Edited at: 10th Apr 2010 05:22
Here is what I've got for the FSM so far. It should give you a good idea of where I'm going with this idea:



It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Apr 2010 07:26
@caleb
Quote: "I would just like to say, Thank you. These posts have taught me A LOT about game planning, team planning, and even coding"

Thanks. If you ever have the gumption to go through the whole thread, there's actually quite a bit of stuff.

@No Time to Code
Quote: "Here is what I've got for the FSM so far."

I see, you are organizing program flow according to named events for easier tracking, it would seem.

Perhaps you've already considered what I'm about to write but anyway: if the states are managed in one place (_update: ) , then shouldn't there be specific code that's gone to for those specific states in pretty much all cases? The update subroutine functions much like a menu subroutine would function where the user makes selections and the code is carried out based on the selection. In the case of the game, the choices are really determined by position of either the player and/or the enemy. A subset being whether or not the player pulls the trigger and shoots.

Now, if the management of events is to be by states of position, action, or inaction, then there perhaps should be separate state tests: one set for positional tests, one set for animations being played, another set for combat. The ultimate goal is organization, I assume. Some states will cancel out the involvement of other states and therefore should be removed from the test altogether.

If an alien is attacking, there should not be a test for any other state for this alien until it's attack state/animation is finished or at the end of a players attack/counter attack, there would be a test for several events:

was the alien hit?
test for damage
enough damage to kill
state changes to play death animation
- no further state tests until death animation is finished for this creature
change state to dead

A hierarchical database as opposed to a relational database stores all of it's data in a giant tree. Any single piece of data has to be searched for through the entire top down to any end branch. A relational database uses an indexing and key system to match linked data so in theory, you can start from any point in the database and retrieve any information matching or tied to the key. Is the relational database more efficient than the hierarchical? Sometimes. But for organization, you just can't beat the big tree where everything is ordered and consistent. But for getting back information, the relational database will cut out a ton of the redundancy you could have with a hierarchical database.

FSM as a concept rather than a description of organization seems to me to be along the lines of a hierarchical data structure. You follow down active branches to a result. Where I suspect inefficiency could sneak in, is in having to test each branch for whether it's active or not.

Quote: "As I understand FSM, it will require many more sub/function calls then I'm currently using. I remember you had mentioned cutting down on these calls to improve performance. "

At this stage, it doesn't matter. Do what you need to do. Get it working. A big mistake that I fall into is trying to optimize as I go. If something works without problems, great! If you see an optimization that could be done, note it, then move on to the next thing. When everything is finished, we can always come back to whatever was noted as being optimizable (word?).

I guess overall, I'm trying to say - watch out for redundancy and unnecessary code.

If aliens are dead, they shouldn't even be in the loop of other aliens testing for things like visibility, for example. If they have respawned, then they have other tests.

Enjoy your day.
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 10th Apr 2010 23:18 Edited at: 11th Apr 2010 01:19
ok I've been struggling with this problem for a while now. The gun just wont properly rotate with the camera

here's what I have

It works if you don't turn in the y axis, but it's wrong as soon as you turn around.
I tried fixing it by multiplying it with a cosine function, but that only fixes the problem at 180°
Could someone please give me a little boost?

Attachments

Login to view attachments
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 11th Apr 2010 05:53 Edited at: 11th Apr 2010 05:57
@Latch
Quote: "I see, you are organizing program flow according to named events for easier tracking, it would seem."

It's based on states (you use events but we could be talking about the same thing). At any given time an alien will be in only one state. The CASE-SELECT statement will direct program flow based on the aliens state. Within the case block of code are the actions that will/can be carried out in this stage and the conditions that could cause the state to change.

Quote: "If an alien is attacking, there should not be a test for any other state for this alien until it's attack state/animation is finished or at the end of a players attack/counter attack, there would be a test for several events:"

I hadn't give much thought (until now) about how the playing of a particular animation should override further actions by that alien. Here is a sample of how I think it would work.
Regardless of what state the alien is in (other than dead), if the player shoots the alien it need to react. So let say there is a player combat sub like this and your LOS function determines a shot has hit the alien:


Now the state is set to state_Damage and the previous state is cached. Now there is a section of the stateupdate sub like this:



If that shot killed the alien it will set it state to state_Dead and play a death animation. Otherwise it can play a damage animation and when that animation is complete, restore the alien to the state it was in prior to being shot. While the animation is playing it will remain in the damage state and there won't be any test for other states.
I'm not totally sure how you determine when a particular animation is complete. I assume that if the alien damage part of the animation file was frames 100 - 150 you would

PLAY OBJECT enemy,100,150 when the damage is detected and then use OBJECT PLAYING(enemy) to determine if it's complete.

Quote: "I guess overall, I'm trying to say - watch out for redundancy and unnecessary code."

I will.
Quote: "If aliens are dead, they shouldn't even be in the loop of other aliens testing for things like visibility, for example. If they have respawned, then they have other tests."

This should be better:


@Link102
I might not be the one to help on this but I think it involves using the LOCK OBJECT ON command. It causes the object to ignore the cameras influence.

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith

Login to post a reply

Server time is: 2024-04-24 10:05:36
Your offset time is: 2024-04-24 10:05:36