This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - ben_g
Pages: 1 ... 17 18 [19] 20 21 ... 71
271
« on: November 01, 2013, 11:45:13 am »
I'd suggest to just go with 4 sprites, and make the sprite point in the direction of the key you held down last, or just make it default to values (for example point left when left is pressed, even when the up or down key is held at the same time). It might not look as good than with full 8-directional sprites, but for a calc game, it is fine. Many gbc and gba games even did it like this.
272
« on: October 16, 2013, 02:17:12 pm »
If I had an oculus rift and a drone, I'd totally try that.
273
« on: October 14, 2013, 02:42:20 pm »
First of all, sorry for the late reply, I promised this post over a week ago, but something came inbetween and after that, I kinda forgot about it...
Anyway, I'll start with the final platform, the one you can walk under. It's basically the same as the previous one, but with an added condition: if(X >= Floor.Xstart && X <= Floor.Xend && Z >= Floor.Zstart && Z <= Floor.Zend && Y <= Floor.height && Y > Floor.height-Floor.thickness){ FallSpeed = 0; Y = Floor.height } This will give you a platform with the top at floor.height, and it isn't infinitly thick anymore. It is reccomended to give each platform a thickness of AT LEAST the terminal velocity (or the maximum speed the player can fall in that area of the level), otherwise, it is possible for the collision detection to 'miss' this platform, causing the player to just fall trough it. If you don't add anything to this collision detection, it will act as a 1-way platform, which means that if you jump while you're beneath it, you will go trough and land on the top. If yoou don't want this, you can add a 2nd collision for the bottom, or a 2nd platform right beneath it, which on collision only sets the fall speed and doesn't set the Y-coordinate.
Before we start with walls, there's still something platform-related that may also be usefull for some games: ramps and tilted platforms. It's actually quite simple: Where you first used a fixed value to determine the height of the platform (in the example: Floor.height), you use a simple calculation based on the X and/or Y coordinates. So, if you want a ramp with a 45° angle around the X-axis, you check if Y<Floor.geight+Z, where Floor.height is the lowest part of the ramp. If you want a different angle, you can divide the Z by a number, if you want it more steeph, multiply the Z by a number (multiply Z by the tangent of the angle, if you like angles better). You can also use a different axis than the Z-axis, and you can also use other functions than simple linear ones, but keep in mind that more complex functions take longer to compute. Also, this is still simple, vertical-only collision detection, not a physics simulation. It wil allow you to walk up any ramp, no mather how steep, but it won't let you slide down a ramp. If you want to use this for tilted platforms, it's often best to use the same function for both the top and bottom of the platform, to give it the same thickness everywhere.
If you still want some other kind of platform, feel free to ask, and I'll look into a way to code it.
Now, the walls. They are pretty simular to the platforms, just using other axes and you don't have to mess with the fallspeed. Let's start with the most simple kind, as we did with the platforms:
World borders This one is basically the same as the first 'platform', as it is an infinite plane and it's impossible to walk trough. The only practical use is 'locking' the player in a certain area. It might seem rather useless at first, but considering the limited hardware of the calc, overflows will occur if the player moves to far from the center of the world, so you might want to keep him close to the center. The code is very simple: if(X > Xmax){ X = Xmax } This makes sure that the player can't move beyond Xmax on the X-axis. You can use 4 of those walls to define the uncrossable world borders.
single-sided walls Because walls with infinite thickness are rather useless, we'll move straight to single-sided walls. The code is quite similar to that of the one-way platform: if(X > wall.X && X < wall.X+wall.Thickness && Z >= wall.Zstart && Z <= wall.Zend && Y >= wall.Ystart && Y <= wall.Yend){ X = wall.X } You can leave out the part dealing with the Y-axis if you don't need walls with a particular height. It's reccomended to do this if you don't have an open space above or below the wall.
This will create a wall alligned to the Z-axis. To allign it to the X-axis, replace all Z's by X's and vice-versa. The thickness of the wall should be at least the (max) walk speed of the player, to avoid the player walking trough it. To avoid graphical glitches, offset this wall slightely from the graphical wall.
double-sideed walls Simular to the platform, the single-sided wall will only stop players comming from the right way. If you need a full solid wall, you have to use two walls, like this: if(X > wall.X && X < wall.X+wall.Thickness && Z >= wall.Zstart && Z <= wall.Zend && Y >= wall.Ystart && Y <= wall.Yend){ X = wall.X } if(X < wall.X+wall.Thickness && X > wall.X && Z >= wall.Zstart && Z <= wall.Zend && Y >= wall.Ystart && Y <= wall.Yend){ X = wall.X+wall.Thickness } This creates a wall that is solid from two sides, but if you walk into the ends, you'll ennd up at one side of the wall, instead of stopping there. If you want to stop there, add single sided walls at the ends, alligned to the other axis than the main wall.
You can make the top and/or bottom of a wall tilted, or follow a function, in the same way as with the platform. If you want to use walls as sides of a platform with a non-level top, it's reccomended to do so. And if you're dealing with a ramp, don't add a wall where the tilted edge connects to the ground, and if you make the walls of the triangular side stop a bit in front of that angle, then you don't have to walk up the ramp from the edge where it connects to the ground, but you can then also walk onto it from the sides where it is still low.
This ends the walls part. If you have any questions or if you want me to look into an other type, feel free to ask.
274
« on: October 13, 2013, 12:25:06 pm »
I don't think you have to worry much about the server not being able to keep up with the calcs, unless you are doing really complex server-side calculations. If the server has to handle so many objects that it starts to cause lagg, the calcs won't be able to handle it either anyway. And for the request rate: I'd go for 2-4 times per second (standard), and add some kind simplified calc-side object handling to make everything more smooth (eg. send the speed for moving objects to the calc and make the calc cumpute it's movement untill it recieves new data, so that moving objects look like they move instead of 'teleporting' from one place to another).
275
« on: October 02, 2013, 03:21:12 pm »
Well I guess Fog, DOF, God rays, motion blur, bloom is not really calc level. But I work on some real-time shadows casting, and now I can have a sun with shadows ! (pretty limited for the moment though : shadows only on the ground (no user-defined plane) , and the light source is multi directionnal and must be the most higher point in the decor)
You really have shadows? That's actually pretty awesome for a calc engine. The suggestion of those effects was just a joke. For collision: if a simple system like the one I used in my racing game, it's not hard at all: This is how the collision with the ground is done: The player should have a variable that represents the speed at which it falls. At the beginning of the update loop, increase that variable with a value that represents the gravity, and make sure it doesn't go above a certain value (let's call that value the terminal velocity) to make sure that if the player falls a long way, it still won't go so fast that the collision checking may miss it. Play around with that value to see what looks realistic (depends on the size of your units and the framerate). At the end, substract the falling speed variable from the Y-coordinate of the player(Y is the up axis, right? Otherwise, use the axis that points up). You can repeat this for other objects that need collision checking, but every one of those needs it's own falling speed variable. For a simple collision with an infinite and flat ground (the simplest and fastest kind), you basically do this: If(Y <= [Ground level]){ FallSpeed = 0; Y = [Ground level] } In words: if the player/object is at or below the grown level, set the fallspeed to 0, and set the Y position of the player (or object) to the ground level (so that if the player hass fallen slightely further than ground level, the player will still end up on the ground). This method is quite fail-safe because it's impossible for the player to fall trough this floor, even when the player fals at a high velocity. You can also add position parameters to the above method. This can be used in the combination with the previous method to create a raised area in the otherwise flat world: if(X >= Floor.Xstart && X <= Floor.Xend && Z >= Floor.Zstart && Z <= Floor.Zend && Y <= Floor.height){ FallSpeed = 0; Y = Floor.height } With this kind of platform, it is also impossible to fall trough it, but it needs additional collision checking for the sides, because otherwise, a player walking into the edge of the platform will be teleported to the top of the platform. It's also possible to do this with platforms that aren't rectangular or aren't alligned with the X/Z axes, and for that, you replace the if above with one that checks if the player is inside the 'shape' of the platform. This does need a lot more processing power, though. I'll explain some other things, like simple walls and 'floating' platforms (where you can walk underneath and stand on top of them) tomorrow. BTW: The FallSpeed variable can also be used for an other application than falling: jumping. Set it to something negative, and the player will go up, decellerate, accelerate again towards the floor, and stop when it hits the floor. By setting this to a large negative value, the player will fly up really high.
276
« on: October 01, 2013, 03:06:40 pm »
Just a little question to all of you :
What do you want me to add to the library? (new feature .... )
The following shaders/effects: Fog, Water, real-time shadow casting, DOF, God rays, motion blur, bloom Now serious: Better documentation and more examples: The current documentation is a bit hard to use, and (not meant offensive), it kinda feels incomplete and like it was written in a hurry. And the examples do demonstrate what the engine can do, but it would be very usefull to programmers if you'd add comments (maybe in a .txt file so it can be read on a computer) for everything that uses a part of the library to describe in detail why it's there and what it does. A simple tutorial to get started might be nice too. Finally, a real feature: It would be nice to have some basic collision detection. It would be okay for me if it could only handle rectangular shapes, even if they are alligned to the x and y axes. This is easy to program and doesn't require a lot of calculations so it is not slow. If you're unsure of how to implement collision detection, I wouldn't mind to help. BTW: About the documentation: It can be hard to write clear documentation because even when it's incomplete, it will be clear to you because you know how it works. Therefore, it helps if you let someone read it who hasn't used the library yet, and if he(/she) understands it, then you can be almost sure that most other people will understand it too.
277
« on: September 30, 2013, 02:07:51 pm »
Yep it's totally real and it's not even done by genetic modification but just by sticking them on top of each other
LOL pretty cool. Though that's a bit cheating.
Not really, grafting can result in a viable hybrid organism. Granny Smith Apples, for instance.
Many plants can be modified in this way, though this is usually done with fruit trees. For example, in some garden stores, you can buy trees that grow two kinds of apples. Multiple kinds of fruit are possible as well. You can for example add a branch of a pear tree to an apple tree to get a tree that grows both apples and pears. But this technique is quite time-consuming and often fails,and is thus rather expensive (it is cheaper to buy seperate plants, and they will also give you more fruit).
278
« on: September 25, 2013, 04:15:49 pm »
Axe is quite low-level. It doesn't have a picture/sprite type, the pic variables you work with are just 16-bit numbers that indicate where a sprite is located in the RAM memory of the calculator. And because they are numbers, you can do math with them. And if you store your sprites one after the other, adding 8 to it (8*8 sprites are 8 bytes large) makes it point to the 2nd sprite (starting from where you defined the variable you're working with). Adding 16 to it would give you a pointer to the 3rd sprite, and so on. To use this in an annimation, you use a variable that starts at 0 and increases every frame. When this 'counter' variable reaches the number of frames you have, set it to 0 again BEFORE you start to work with it. Now you should have a variable that will always be between 0 and the number of frames in the annimation MINUS ONE. It is very important to count in this way in programs. Where you display the sprite, instaed of just using the pointer (pic variable), you use for example Counter*8+Pic1. This is all there is to it. It should work now.
Extra explanation: You might wonder now why you have to start the counter at 0, and why you have to count to one less than the number of frames. Well, this is because the pointer, Pic1 (or whatever variable you have shosen), points to the 1st frame. Adding a counter of 0, multiplied by 8 (which is still 0) to it, it still points to the 1st frame. If your counter increases to one, counter*8+Pic1 will point to a location in RAM 8 bytes further than the first frame of the annimation, and that is exactely where the 2nd frame begins. So a counter of 1 gives you the 2nd frame. And if your pointer is 7 and you have 8 frames, than it will show you the 8th and last frame. This is why the counter is always one less than someone with no programming experience would expect. And if you've ever worked with arrays and wondered why they started coounting from 0, it's because they work the same. The sprites stored one after the other is basically just an array of sprites. If you don't know what arrays are, you don't have to care about them, since in axe, you don't have pre-made arrays.
I hope it's more clear to you now. If there's still something you don't understand, feel free to ask, because if you don't know exactely how code that people give to you works, you might be able to use it, but you won't be able to modify, extend and optimize it to fully suit your needs.
279
« on: September 17, 2013, 03:52:17 pm »
It looks quite pretty with the color and the higher resolution.
Will there be some form of backwards-compatibility for b&w programs that use only the routines provided by the shell for drawing and/or programs that use the DCS gui engine for it's graphics?
280
« on: September 11, 2013, 12:54:21 pm »
Interrupts occur for a fixed amount of time per secound. It isn't exactely the same on all calcs, and it isn't as acurate as the clock or crystal timers, but it's good enough for a frame counter.
281
« on: September 10, 2013, 04:06:39 pm »
If you really want battery life, you might want to consider buying a normal phone instaed of a smartphone. I am currently using a nokia C2-01, and it does the job very well for me. It's controlled by normal buttons instead of a touch screen (which also means that the screen is smaller than on smartphones), but the screen size and resolution isn't that bad. Also, the phone is very sturdy. I have dropped it several times, and there are no cracks or scratches in the screen. It has also got a few built-in apps, and most of them are usefull (agenda, a thing to save notes, a timer, an MP3 player, a video player, and a few games including snake). The video player doesn't support a lot of formats, though. It also has got a reasonable camera (3.2 megapixels), and a battery life of almost 2 weeks with minimal use and 2-3 days when you use it (and especially it's camera, which seems to use a lot of power) a lot. So if you're only goning to use it as a cellphone and agenda, I would suggest this phone or a simular one. With a price of ~€80, it's well below your budget as well. However, if you are looking for a mobile gaming and internet device, then it is less suitable for you, since this phone has no wifi and not a lot of games are made for it.
Edit: Both me (who owns this phone) and my friend (who owns a Samsung Galaxy Mini) agree that this cellphone is more usefull for school stuff.
282
« on: September 09, 2013, 06:08:00 pm »
I think he said on omnimIRC that that was 15MHz. But still, 7fps for a textured cube is very good for pure axe.
283
« on: September 09, 2013, 01:13:05 pm »
That's a commercial for an ultra HD tv. I just came across the video on youtube. I think that it's a pretty good joke, and LG really found an original way to showcase their new TV. (Even though it probably would work just as well with any tv that has a decent resolution, just because you wouldn't expext a tv there) Anyway, here's the link if anyone wants to view the video:
284
« on: September 04, 2013, 11:19:18 am »
Look trough the OS routines. There should be a bcall that you can call to make the OS parse the input.
EDIT: I just noticed it was axe, so this has to be done by using a bit of assembly.
285
« on: September 03, 2013, 05:20:56 pm »
You can just edit the splashes.txt file to add your custom splash texts. And iirc resource packs can change them as well.
Pages: 1 ... 17 18 [19] 20 21 ... 71
|