Hi there, this may be the wrong forum (move to talk & chat if you want) but there are a few technical issues I'd like to get a brief understanding of.
Firstly, isometric games. Say I wanted to make a game a bit like Transport Tycoon, construction etc. Is there a way to make a tile-based grid in AGS so that you can select say a hotel & place it on a particular "tile"? I don't need to know the code here, just whether it's possible & roughly how I'd go about doing it.
Also, what if I wanted to have cars moving about? Can AGS handle defined & random paths, and can it handle the strange angles too, because if there aren't more than 4 angles there is still the fact vehicles/iso objects etc are all on a slant. I can't really explain this one but if you know what I'm getting at please do tell me what's possible :)
Secondly, puzzle games but in more depth - something like TIM. If I had an object that looked like a conveyer belt, would I
a) Be able to create a free falling ball in AGS that could bounce
b) Make that ball move in the direction of the conveyor animation when it collides with it?
Okay, that's all for now, but I'm sure I've got more coming. Any help is much appreciated!!
ps - yes I know AGS is for adventure games :P
Isometry and tiles will require quite a bit of scripting, but it should be possible, although you're probably better off with non-isometric tiles. There is a pre-made script for declaring and using two-dimensional arrays floating around the forums somewhere... you might want to use that ;)
For moving characters along predefined paths, try the CCS plugin (also floating around somewhere) and 'creative' scripting.
You should also be able to script a bouncing ball. It'll probably be quite a bit of an effort to include the various physical laws that are in action there, but it should be possible.
Let me try to give you my opinion on these things:
1. Make a grid based game:
Yes, you can do that. Very basically speaking you define a big struct for your tile containing information like the land value, the kind of building that is built on it and then you instance this struct in a big array. This array is then accessed via mouse coordinates.
2. Moving cars:
You could win a coding-competition with that ;) Taking into concideration that the user can create the raod system himself you would have to dynamically assign x and y coordinates to the streets and then move the cars (possibly charaters using the "walk" function) from one point to the other. You would also have to give the different pieces of road a different priority (or say weight) so that if the car comes to an intersection it can deside which way to turn based on these weights.
3. View and directions:
I don't see this as a big problem. Although everything is tilted in an isometric game the car still only has its for directions to travel: up, down, left, right. So you would just draw the up and down views of the cars at the slanted angle of your game. And in the game then, when the car drives from one coordinate up to another coordinate (which is slightly offset because the view is isometric) it would automatically fit the perspective.
4. Create a ball with gravity and bouncing:
I actually coded exactly that for my next game. I must admit it was quite possibly the hardest (most mathematical) code I've ever written. But yes, it definitely can be done.
However be prepared to use a lot of workarounds or 'pseudo-physique' as - after all - AGS is not a physics-engine :)
5. Make the ball get influenced by a conveyer belt:
In my version the ball bounces of walls, and even get's slowed down by the different frictions of the surfaces. So yes, you can influence the movement. As the ball collides with the conveyer belt, just add a certain amount of degrees to the "ouput angle" of the ball and it should give the desired effect.
The main problem I see with all this (and have experienced myself when trying to create non-adventure games with AGS is the decision where to use Characters, objects, GUIs or RawDraw functions. And some of these items use different placement coordinate systems which doesn't simplify things ;)
So that's my opinion on your questions.
I hope my English was understandable.
I'm looking forward to how this thread evolves.
Stefan
Seeing as how Rollercoaster Tycoon has adjustable height, for rides and land, you would need an array for the height map, which would be adjusted by the land value.
Also, wouldn't something like that bog down AGS? Showing all that stuff at once would be really laggy.
Moving cars would be different I think. You could randomize the path with something like this I think:
Character.AddWaypoint(Random(320), Random (240)) // your resolution here
Now that I think about it, that would be stupid. I don't think that would work very good because it would be putting waypoints on non-walkable areas.
Quote from: m0ds on Tue 31/07/2007 14:41:05
Say I wanted to make a game a bit like Transport Tycoon, construction etc. Is there a way to make a tile-based grid in AGS so that you can select say a hotel & place it on a particular "tile"?
Yes. It isn't even all that hard, just create an array (pretend it has two dimensions, e.g. arr[xpos + 50 * ypos]) that holds the tile data, and use two nested while-loops to put them on-screen with RawDraw. Objects and characters conveniently go on top of that.
Quote
Also, what if I wanted to have cars moving about? Can AGS handle defined & random paths, and can it handle the strange angles too,
This is slightly trickier because you'd have to code it yourself. You can use MoveCharacterPath and such, but you'd have to calculate the distance and implement some pathfinding algorithm.
Quote from: TheMagician on Tue 31/07/2007 15:21:48
4. Create a ball with gravity and bouncing:
I actually coded exactly that for my next game. I must admit it was quite possibly the hardest (most mathematical) code I've ever written. But yes, it definitely can be done.
However be prepared to use a lot of workarounds or 'pseudo-physique' as - after all - AGS is not a physics-engine :)
This should not be very hard.
Do something like this:
struct Ball {
float vx,
float vy,
Object* o
};
Then create an object and point the o pointer to that. Then in repeatedly_execute:
//gravity
Ball::vy = Ball::vy + 9.82*1/40; // every frame is 1/40 s long.
//update position
Ball:: o.x = Ball:: o.x + vx;
Ball:: o.y = Ball:: o.y + vy;
Of course you then need to change the sign of the velocities when the ball bounces against something.
Personally I think attempting an isometric tile based tycoon game would be quite a bad idea. AGS provides practically no functionality for this sort of thing, since you'd have to code the tile mapping, rendering, character handling, clicking, scrolling, and all the game logic yourself. There'd be nothing to gain over coding it outside AGS, and plenty to lose because AGS's script language isn't designed to be a general purpose game programming solution.
The other kind of game, TIM type puzzles, would also be very difficult. Physics puzzling requires a lot of mathematical coding, which is quite difficult in any language, especially one not designed for it. You could simplify things a great deal and still make a similar sort of game I suppose. Overall it seems less problematic than the tycoon type game.
Either of these games would be made faster in Game Maker, or put together in a standalone scripting language.