[QUOTE=Robber;16750192]If I'm not mistaken that's an infinite recursion. If you divide an integer by 10 the result can only be 0 if it the integer was 0 before.[/QUOTE]
an integer cannot have a floating point, so it rounds down.
(900/ 10)= 90
(90/ 10)= 9
(9/ 10)= 0
[QUOTE=qurl;16753086]the green bits are 5x5 tiles and the blocks are 25x25. Probably best to do it that way so you can just make 5x5 tiles to have a different style border without making a whole new block bit[/QUOTE]
So if Understand right the green grass is 5x5 images? Thats a lot of images your blitting to the screen, thats going to be slow.
Currently I have a 25x25px image for every different situation (left cliff, grass on top, right cliff and grass on top, same for right etc)
[QUOTE=ryandaniels;16753290]an integer cannot have a floating point, so it rounds down.
(900/ 10)= 90
(90/ 10)= 9
(9/ 10)= 0[/QUOTE]
:doh:
Didn't think of that. :downs:
Building a level editor for my game, it uses vector rects for collisions.
[img]http://i32.tinypic.com/ix49z5.png[/img]
These images show the layers, scenery is the layer for things you can see, and active is the layer for collisions and buttons etc. The yellow block is the currently selected item.
[url]http://i32.tinypic.com/ix49z5.png[/url]
[url]http://i29.tinypic.com/2cmxcfr.png[/url]
[url]http://i28.tinypic.com/260a32p.png[/url]
I need to add sprites to the scenery layer.
[IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/sweet.png[/IMG]
[IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/sweet2.png[/IMG]
An attempt at gravity, kinda of a test to see if I could use it in a game I have in my head.
Looks pretty awesome to me so far, but I'm pretty sure planets don't orbit like that, so what am I doing wrong?
[code]
Point Gravity::GetForce(Point location_, int mass_) {
int time_past= SDL_GetTicks()- clock;
clock= SDL_GetTicks();
float magnitude;
magnitude= FindPowTen(mass/ mass_)* (time_past/ 10.0f)* ( 1.0f/ location->Dist(location_) );
float direction= location_.Angle(*location);
return Convert_FROM_DirMag(direction, magnitude);
}
[/code]
(only line really doing anything important):
[code]
magnitude= FindPowTen(mass/ mass_)* (time_past/ 10.0f)* ( 1.0f/ location->Dist(location_) );
[/code]
Basically, I determine how many powers of ten larger the gravity object's mass is compared to the satellite, then I multiply that by the how long it was been since the last frame divided by an arbitrary time/unit value (frame-independent movement), and finally, I multiply that by that by the distance between the objects which has been changed so that the closer they are the higher the value is. Then I just convert the magnitude and direction into XY units of speed.
[editline]09:53AM[/editline]
[IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/sweet3.png[/IMG]
This is too much fun.
Still open to information; I doubt I'm doing it the "right" way, as my first physics class is tomorrow :v:
[QUOTE=ryandaniels;16754492][IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/sweet.png[/IMG]
[IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/sweet2.png[/IMG]
An attempt at gravity, kinda of a test to see if I could use it in a game I have in my head.
Looks pretty awesome to me so far, but I'm pretty sure planets don't orbit like that, so what am I doing wrong?
[code]
Point Gravity::GetForce(Point location_, int mass_) {
int time_past= SDL_GetTicks()- clock;
clock= SDL_GetTicks();
float magnitude;
magnitude= FindPowTen(mass/ mass_)* (time_past/ 10.0f)* ( 1.0f/ location->Dist(location_) );
float direction= location_.Angle(*location);
return Convert_FROM_DirMag(direction, magnitude);
}
[/code]
(only line really doing anything important):
[code]
magnitude= FindPowTen(mass/ mass_)* (time_past/ 10.0f)* ( 1.0f/ location->Dist(location_) );
[/code]
Basically, I determine how many powers of ten larger the gravity object's mass is compared to the satellite, then I multiply that by the how long it was been since the last frame divided by an arbitrary time/unit value (frame-independent movement), and finally, I multiply that by that by the distance between the objects which has been changed so that the closer they are the higher the value is. Then I just convert the magnitude and direction into XY units of speed.
[editline]09:53AM[/editline]
[IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/sweet3.png[/IMG]
This is too much fun.
Still open to information; I doubt I'm doing it the "right" way, as my first physics class is tomorrow :v:[/QUOTE]
Gravity isn't constant, Gravity on earth is (roughly) 10 due to the mass of the planet and the radius of the planet.
Using Newtons Law of gravitation:
acc = 6.67*10^-11 * Mass_of_planet/ radius^2
This should give you realistic motion of orbit, but another way is to use:
f = (m * v^2)/r ->
acc = (v^2)/r
Where the acceleration towards a point required to keep an orbit is it's velocities squared divided by the radius of orbit. So Revolving around a point at 5 pixels/s and a distance of 100 pixels would require an acceleration of 0.25 pixels/s^2 towards the point.
[editline]06:07PM[/editline]
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Update!
I retried using Polygons and now it's started working! I've Just finished writing code to allow me to draw different slopes with different colors, and so I have something to show of!
With Grid (draw as an overlay)
[img]http://img26.imageshack.us/img26/6179/iso1.png[/img]
Without Grid:
[img]http://img26.imageshack.us/img26/3923/iso2.png[/img]
[QUOTE=Mattz333;16755140]Gravity isn't constant, Gravity on earth is (roughly) 10 due to the mass of the planet and the radius of the planet.
Using Newtons Law of gravitation:
acc = 6.67*10^-11 * Mass_of_planet/ radius^2
This should give you realistic motion of orbit, but another way is to use:
f = (m * v^2)/r ->
acc = (v^2)/r
Where the acceleration towards a point required to keep an orbit is it's velocities squared divided by the radius of orbit. So Revolving around a point at 5 pixels/s and a distance of 100 pixels would require an acceleration of 0.25 pixels/s^2 towards the point.
[/QUOTE]
Thanks :D
[QUOTE=Mattz333;16755140]
Update!
I retried using Polygons and now it's started working! I've Just finished writing code to allow me to draw different slopes with different colors, and so I have something to show of!
With Grid (draw as an overlay)
[img]http://img26.imageshack.us/img26/6179/iso1.png[/img][/QUOTE]
Awesome. How are you deciding which direction to draw the polygons on each tile. Like how do you decide which 2 verts are going to be the edge that goes across the middle of the polygon. Hard to explain my question :\
I've been writing an OS (In C++*) but it's a slow process and I am finding it hard to get the motivation most days
(Without the hand-holding tutorials, Except for the bootloader which I needed some aid in; I did Discect a tutorial-os to Understand how it was put together and such though.)
[url]http://i17.photobucket.com/albums/b93/tezzanator/os.jpg[/url]
As You can see, I've not got very far, I wanted this to be a long-term do-when-I-am-bored project.
So Far IT Detects the CPU (CPUID) and Sets up the GDT and has a (basic) Text-based Console for debugging. (Ever tried debugging an OS? Ugh)
*I couldn't care less about linus' views.
[QUOTE=r4nk_;16756531]Awesome. How are you deciding which direction to draw the polygons on each tile. Like how do you decide which 2 verts are going to be the edge that goes across the middle of the polygon. Hard to explain my question :\[/QUOTE]
This is probably the biggest section of my code, basically I have 2 shapes that are use for all tiles, one with 4 points and one with 3 points.
I have an if statement for each possible arrangement of points (I'm going to restrict certain arrangements like what RCT did) and have a rendering code for each of these arrangements. If it is one of the ones that have a line through the middle (one corner is up) I change the 3 sided poly to make one half of the square, color it, draw it then manipulate the poly again to make the second half, color it then draw it. For tiles that aren't 'folding' I just use the 4 sided polygon and move it's points to the nodes then color + draw it.
For that section alone I have 300 lines of code to describe all possible arrangements.
I've just finished writing what I think is all the arrangements that are allowed in RCT and edited the shades so they look natural. I've also added some Mouse detection code that allows nodes to be raised.
[QUOTE=Tezza1234;16756578]I've been writing an OS (In C++*) but it's a slow process and I am finding it hard to get the motivation most days
(Without the hand-holding tutorials, Except for the bootloader which I needed some aid in; I did Discect a tutorial-os to Understand how it was put together and such though.)
[url]http://i17.photobucket.com/albums/b93/tezzanator/os.jpg[/url]
As You can see, I've not got very far, I wanted this to be a long-term do-when-I-am-bored project.
So Far IT Detects the CPU (CPUID) and Sets up the GDT and has a (basic) Text-based Console for debugging. (Ever tried debugging an OS? Ugh)
*I couldn't care less about linus' views.[/QUOTE]
I have no idea how to write an OS, sot this question might seem stupid, but I thought you need a different C++ compiler for every OS. How do you compile code for a OS that you made yourself?
And one more question: Did you write the really very low level stuff in assembler? I always thought you couldn't do that in C or C++.
[QUOTE=Robber;16757163]I have no idea how to write an OS, sot this question might seem stupid, but I thought you need a different C++ compiler for every OS. How do you compile code for a OS that you made yourself?
And one more question: Did you write the really very low level stuff in assembler? I always thought you couldn't do that in C or C++.[/QUOTE]
Question one is something I am still grasping myself as I learn, From what I can gather It's a case of either:
1) The OS Implementing an existing Binary Image format (PE EXE, ELF...) and Linking in your kernel libs
2) Creating your own image format and creating a Cross-compiler for it
The bootloader-kernel "glue" is in "Assembler", The assembly code defines a multiboot header (I'm Using GRUB As my bootloader for now, Till I get a stable system) , calls all the constructors, Then calls my kernel-main (A Global function declared as Extern "C" to prevent name-mangling) - This is what I needed a tutorial for As I am not the best at it,, But I am getting there; Having done Assembler for PICs the concept carried over, the instructions still boggle my mind at times, some of them are just annoying (A 20-bit Segment:offset setup for higher-memory for example had me scratching my head at first) - Thank god for intel docs!!
Some other parts are also in Assembly language, Mostly utility functions, that use inline assembly. (HLT is damn helpful for debugging :O)
You do need to disable a large portion of C++'s higher level features and reimplement them yourself (Exceptions for example)
As I say I am still learning myself so I may be a bit off - I have learnt a fair bit about the x86 architecture doing this though.
[QUOTE=Tezza1234;16757598]alot of text[/QUOTE]
:aaa:
That sounds very complicated
Yet very interesting
[QUOTE=Mattz333;16755140][img]http://img26.imageshack.us/img26/3923/iso2.png[/img][/QUOTE]
You need a depth buffer system.
starting ui lib
[img]https://dl.getdropbox.com/u/99765/ui1.png[/img]
multiple windows, dragging, resizing, yadda yadda
[QUOTE=Overv;16757856]You need a depth buffer system.[/QUOTE]
Why does he?
[QUOTE=Jallen;16758048]Why does he?[/QUOTE]
Because he's shading the tiles individually? I dunno
Oh wait, I didn't see he solved it in the picture without lines.
[QUOTE=qurl;16757970]starting ui lib
[img_thumb]https://dl.getdropbox.com/u/99765/ui1.png[/img_thumb]
multiple windows, dragging, resizing, yadda yadda[/QUOTE]
I like the art direction in this, Programmer art is usally AWFUL.
[QUOTE=Overv;16758081]Oh wait, I didn't see he solved it in the picture without lines.[/QUOTE]
Ah yes I see what you mean now looking at the picture with lines.
[media]http://www.youtube.com/watch?v=MLsuPM6v0IY[/media]
Here's some progress on my game some more. I think I'll call it [B]Arcane, Stealth and Power[/B]. Just because I suck at names.
What language is that in Namelezz?
[QUOTE=Funcoot;16758367]What language is that in Namelezz?[/QUOTE]
Will Programming section form a lynch mob if I told I made that thing in [url=http://www.scirra.com]Scirra's Construct?[/url]
[QUOTE=Tezza1234;16758104]I like the art direction in this, Programmer art is usally AWFUL.[/QUOTE]
Its a habbo clone lol, it uses the same browsers etc.
It's the end product that counts, Not what it was designed/programmed in. - This should be the general thinking.
Why Have I never seen Scirra's construct beore :o
[QUOTE=Tezza1234;16758444]It's the end product that counts, Not what it was designed/programmed in. - This should be the general thinking.
Why Have I never seen Scirra's construct beore :o[/QUOTE]
I know, I was just curious. I was wondering if he was still using Construct for his stuff.
Also, Construct is kind of like Game Makers, except free and nicer. I believe it even has support for python.
I know that people (here at least) will start bashing it, but Construct can actually be a good platform for rapid prototyping so you spend less time coding. Even programmers can find use in stuff like Construct. I don't personally use it, but it does have it's uses.
[QUOTE=Tezza1234;16758444]It's the end product that counts, Not what it was designed/programmed in. - This should be the general thinking.
Why Have I never seen Scirra's construct beore :o[/QUOTE]
Relatively new and still only in beta releases. It's getting close to 1.0 which is when they give us multiplayer modules and other new stuff. We already got destructible terrain possibilities, particles (even soft particles), physics and a lot of shader model 2.0 effects (HDR, bloom, blurring).
[editline]07:35PM[/editline]
[QUOTE=Funcoot;16758464]I know, I was just curious. I was wondering if he was still using Construct for his stuff.
Also, Construct is kind of like Game Makers, except free and nicer. I believe it even has support for python.
I know that people (here at least) will start bashing it, but Construct can actually be a good platform for rapid prototyping so you spend less time coding. Even programmers can find use in stuff like Construct. I don't personally use it, but it does have it's uses.[/QUOTE]
Thanks Funcoot. I know people will probably be like "Why post in Programming forum?" but I didn't want to start a riot at the Video Games section to get people beg for release dates and make me more hasty.
What I wanted was to get constructive criticism and stuff in a relatively peaceful place where people won't be hurrying me up and instead letting me release a good, polished product.
[QUOTE=Tezza1234;16758104]I like the art direction in this, Programmer art is usally AWFUL.[/QUOTE]
yeah but them little windows use a texture from another game, the rest are just basic isometric things
Even if it was construct I wouldn't of been able to tell, its just so beautiful.
Thanks, I'll try to keep you guys updated as to the progress of my game - right until it's ready for release for the real general public.
Sorry, you need to Log In to post a reply to this thread.