Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Collision Question? (http://www.alice.org/community/showthread.php?t=4416)

Watsamax1 05-13-2010 06:44 PM

Collision Question?
 
First off I know how to make a collision method. But Im making a medieval RPG style game and I'm using old-western terrains I have two of them. I'd like to add collision to them but not have a million squares,cones,boxes or whatever. My game is already like 75mb so the easiest efficentes way should be good.

Watsamax1 05-15-2010 12:58 PM

C'mon 43 view no post :(.

Watsamax1 05-15-2010 12:59 PM

Also for forest is there a collision way but still able to enter the forest.

Dameria 05-15-2010 01:03 PM

I would really have to see your program in order to determine the best collision for you. Forest? Well you could put a square in the trunk of every tree near where eye-level is of the person walking. Then you can put them in a group and just say "If(person is within 'x' meters of item_from_treetrunks), person move backwards 0.5 meters" or something like that. Thats the best way I can think of for being able to go through the forest but not through the trees.

Watsamax1 05-15-2010 04:36 PM

Would that make m game lag its like 82 mb already. But ill try it.

Watsamax1 05-15-2010 05:18 PM

I got a idea for the western. I use forest and plant them outside the terrain. i make collision on them. Also the box idea i think id save space just using the trees.

Dameria 05-15-2010 05:26 PM

Just using the trees would save space, but only do that if the root of each individual tree is near eye level, because the further up or down it is, the harder it will be to make an accurate collision detection. Also, cubes are only about 3 kb, so it would barely take up any space, thats why I use cubes all the time in my programs for placeholders (I hate using dummies because you can't move them manually by dragging).

Watsamax1 05-15-2010 05:30 PM

I just whish there was a group if near group move away.

Dameria 05-15-2010 05:51 PM

Well, someone would have to create that. You just want the Alice team to do most of the work for you by creating methods for you to use. They have already created most of the methods for you, like moving and turning, its up to you to figure out how to do the rest. Plus, collision really isn't too difficult. Just put them into a group yourself and create a method to push the person away.

Watsamax1 05-15-2010 08:00 PM

Its not hard but its just when you get 50 something forest with 28 trees to each forest. And well now i have to redo my world i lost like 2-4 hours.

Dameria 05-15-2010 08:06 PM

Don't even start the collision on that world then, it won't be able to handle it. There is a way that I know where you can put every tree in quadrants of forests, and it would be able to run successfully without much lag. I am currently testing it right now with my own game (results are very good), but I only have 4 quadrants in the game that I am making it in. To make a game with 50 quadrants would take a very, very, very long time (it has taken me about 2 hours just to place all of the walls, and another 2 hours to figure out and create the code, and now I am testing it to make it better).

If I were you, I would just let the people walk through the trees, its not worth the time you would have to invest on making the collisions.

Edit: Hmm, well if all of the trees are already within a "forest" object, it might not be too hard putting them all in groups, but it would still take probably 5-10 hours just to create the collision.

Watsamax1 05-16-2010 08:32 PM

I already got collision. I just downsized everything again. castles got it with ability to enter it. church shacks windmills. Dameria do you know a good wood texture i could get in game. Or a decent wooden barn. a red barn in a medieval world just kinda ehhh. And good luck on your test world :D.

Watsamax1 05-16-2010 08:37 PM

ill probably go with no collision on the forest. at-least the buildings got it so. Do you got a idea for collision on a barn, shack? im pondering to just use cones but do you got a idea?

Dameria 05-16-2010 08:39 PM

Is this a good wood texture for you?

[url]http://www.photoshoptextures.com/wood-textures/wood-texture.jpg[/url]

Dameria 05-16-2010 08:42 PM

[QUOTE=Watsamax1;21412]ill probably go with no collision on the forest. at-least the buildings got it so. Do you got a idea for collision on a barn, shack? im pondering to just use cones but do you got a idea?[/QUOTE]

For the barn, you could always just use the collision method I used in the maze game and just put 2d squares on the outsides of the barn. You can make it only do collision when you are close to the shed by putting in an infinite method looping every 2 seconds saying "If(camera is within 15 meters of barn), do barnCollision" and then have the collision method for each square of the barn. You can do this for every building in the game (hmm, I guess I just thought of another good method of collision detection without causing lag :))

Watsamax1 05-17-2010 03:06 PM

Thnx for the collision idea. :D. I found a wood texture near perfect. wish the doors matched though. I used the battle axe handle.


All times are GMT -5. The time now is 01:16 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.