Prototype
+2
leewatson1
raffitz
6 posters
Page 1 of 1
Prototype
I'm going to start Flashgate from scratch, and I'm currently designing the sprites (One down and thirty-one to go), all very pixely, without shadows and fancy graphic effects.
However, I wanted to start building a prototype for the engine, and here it is, still on early stages of development.
I've managed to duplicate the movement from Flashtrek, and next in the order of business is changing the star field (I didn't make that, I got the code from here)direction to match the ship (when the ship goes left, the stars go right; It's very easy, just fiddling a bit with the maths), and then having the ship always on the centre. In flashtrek, I believe Vex made the ship motionless (the rest of the universe moved instead). I, however, am using the Flixel AS3 library (a free library that's very useful), and that makes it much easier.
So, what do you think?
However, I wanted to start building a prototype for the engine, and here it is, still on early stages of development.
I've managed to duplicate the movement from Flashtrek, and next in the order of business is changing the star field (I didn't make that, I got the code from here)direction to match the ship (when the ship goes left, the stars go right; It's very easy, just fiddling a bit with the maths), and then having the ship always on the centre. In flashtrek, I believe Vex made the ship motionless (the rest of the universe moved instead). I, however, am using the Flixel AS3 library (a free library that's very useful), and that makes it much easier.
So, what do you think?
Re: Prototype
Good so far, if you need a hand with anything just holler
leewatson1- Lt. Commander
- Number of posts : 3432
Age : 30
Location : In the cookie jar
Registration date : 2008-01-27
Re: Prototype
wow, sounds ambitious, the game will be epic upon release so i cant wait, but u can fly off the screen, i personally prefer vex xiangs version of bieng stuck int he middle, though perhaps adding slight movement, like your actual ship going closer to the direction ur moving, the faster u go, whilst the background is moving
skembri- Passenger
- Number of posts : 2
Registration date : 2010-09-11
Re: Prototype
skembri wrote:wow, sounds ambitious, the game will be epic upon release so i cant wait, but u can fly off the screen, i personally prefer vex xiangs version of bieng stuck int he middle, though perhaps adding slight movement, like your actual ship going closer to the direction ur moving, the faster u go, whilst the background is moving
raffitz wrote:next in the order of business is (...) having the ship always on the centre. In flashtrek, I believe Vex made the ship motionless (the rest of the universe moved instead). I, however, am using the Flixel AS3 library (a free library that's very useful), and that makes it much easier.
Re: Prototype
Darkjedi wrote:Cool, with a new engine, we won't have the build bug! YES!
I don't know if I'll add space stations, there are so few on the shows... But I'll definitely add supergates. And they won't have only one destiny like FT's wormhole generator.
So, I have a new file for you to check out. I did some of the stuff I was meaning to, but I still have to adapt the stars' speed. The little text showing the ship's X and Y coordinates will not be featured on the final game. It was only added for debugging purposes.
Linky link
This version's known bugs:
- Starvoid: Not a real bug. It essentially consists of a strip of star-less space that appears when you move after the game starts or after you are stopped for a while. It happens periodically, but dissipates after you move around for a bit. When I fix the stars' speed this will be retroactively fixed.
- Quake: When moving at higher speeds, the ship shakes a bit. It happens because FlxG (one of the main classes of the library I'm using) has to do a lot of maths at the same time and ends up neglecting the Follow function (which makes the game screen focus on the ship). It's absolutely impossible to fix without discarding this library (and I'm keeping it). Besides, I think it looks pretty cool.
Last edited by raffitz on 2010-09-23, 15:46; edited 1 time in total
Re: Prototype
I noticed there is no way to fully stop. Will this continue to be a feature?
Shemuel- Captain
- Number of posts : 10418
Age : 32
Registration date : 2007-12-23
Re: Prototype
Shemuel wrote:I noticed there is no way to fully stop. Will this continue to be a feature?
Actually, and if you pay attention to the X and Y labels you'll notice it, you do fully stop. It's the stars that won't stop moving. And they're always on the same speed, but while the ship's moving, it seems they're moving faster but that's because the ship's moving in the opposite direction.
That will be fixed when I
raffitz wrote:adapt the stars' speed.
Re: Prototype
I'm quite interested to see how far this can go, meaning how powerful the engine can be that is
Re: Prototype
OK, I've fixed the star speed. There's still some starvoiding, and the quaking has increased severely. I reduced the number of stars 33% and reduced the Prototype ship's speed by a lot to try and reduce it. I wasn't very successful, but anyway....
The real problem is the star field. It was a pain to get it to do what I wanted, and in order to do so, a lot of maths has to be done instantaneously, and while having four or five sins, cosines and degree to radian conversions per frame is sustainable, the amount of maths it has to do just to have the stars face the right direction while moving at a pace proportional to the ship's is too much for it to run smoothly.
If I approached it like Vex did with FT (by having the ship motionless and the rest of the universe moving), there would be much less straining on the thing, but it's a bit more complicated that way.
Here's the second link of the day, though...
The real problem is the star field. It was a pain to get it to do what I wanted, and in order to do so, a lot of maths has to be done instantaneously, and while having four or five sins, cosines and degree to radian conversions per frame is sustainable, the amount of maths it has to do just to have the stars face the right direction while moving at a pace proportional to the ship's is too much for it to run smoothly.
If I approached it like Vex did with FT (by having the ship motionless and the rest of the universe moving), there would be much less straining on the thing, but it's a bit more complicated that way.
Here's the second link of the day, though...
Re: Prototype
SFTDP
I'm thinking of replacing the current starfield (which has fifty stars of different opacity and speed all moving in the screen) with a starfield made of three layers of PNGs, each with a different opacity (33, 67 and 100%, or maybe 50, 75 and 100%, I don't now yet) that move around.
Even with 4 png instances (in order to cover the whole screen) for each layer all running at the same time, that'll mean 12 objects, and each 4 of those 12 have the same movement. It would spare Flash a lot of calculations... But I'm still thinking it up...
I'm thinking of replacing the current starfield (which has fifty stars of different opacity and speed all moving in the screen) with a starfield made of three layers of PNGs, each with a different opacity (33, 67 and 100%, or maybe 50, 75 and 100%, I don't now yet) that move around.
Even with 4 png instances (in order to cover the whole screen) for each layer all running at the same time, that'll mean 12 objects, and each 4 of those 12 have the same movement. It would spare Flash a lot of calculations... But I'm still thinking it up...
Re: Prototype
Just to recap so I got it straight, how exactly do you have the starfield working now? Like you said about how in BM the universe moves, so what have you done here? Cause I can't quite tell, but you have the ship move bit forward correct?
Re: Prototype
The ship moves a bit forward but that happens under the same principle of the quaking - too much activity at the same time - and part is neglected.
I didn't change anything related to ship movement from Prototype One to Prototype Two (or Three), the only thing I added was FlxG.follow(playership); , which is a function from the flixel library I'm using. FlxG is the class that manages screen stuff and other things (I don't fully understand it), and by calling the Follow function I'm telling the screen to follow the ship. As you can see by the ship's X and Y indicators, it doesn't remain on (320,240) (which is the centre of the screen) the whole time, it really moves around. This function is one of the reasons I chose to use the library...
The stars don't move when the ship is stopped and move a bit (less than sixteen pixels per frame) in the opposite direction (some faster than others).
I didn't change anything related to ship movement from Prototype One to Prototype Two (or Three), the only thing I added was FlxG.follow(playership); , which is a function from the flixel library I'm using. FlxG is the class that manages screen stuff and other things (I don't fully understand it), and by calling the Follow function I'm telling the screen to follow the ship. As you can see by the ship's X and Y indicators, it doesn't remain on (320,240) (which is the centre of the screen) the whole time, it really moves around. This function is one of the reasons I chose to use the library...
The stars don't move when the ship is stopped and move a bit (less than sixteen pixels per frame) in the opposite direction (some faster than others).
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum