|
Post by Tedmilk on Jun 4, 2008 2:39:17 GMT
Hello everyone! So this thread got deleted somehow yesterday, but it's back! Basically, since prior to Christmas last year I've been working on something Tyrian-based in AS3. This will either become a modified port of Tyrian or (most likely) my own game design based on Tyrian. I have some questions on the level structure (these might be slightly different from the last time I posted this thread), namely: 1. Do layers above the first layer always move at a rate that is a multiple of the first layer (i.e. layer two always scrolls at twice the speed of layer 1), or are they all independantly settable? 2. Are the enemies all help in one array, and if so, how does the game know when to put them underneath/on top of certain layers? 3. Are there always three layers, or sometimes more/fewer? Anything else that is related to the questions above would be very much appreciated - I've looked through the source for openTyrian, but I'm having trouble finding what I need since I'm no master programmer or anything. Now the fun bit - check out my progress so far! christracey.mysite.wanadoo-members.co.uk/test.htmlHow does this run for everyone? It's just beginning to chug in the last week of development on my aged Celeron Packard Bell with 192Mb RAM! It's set to 60fps - sorry I don't have an FPS counter implemented thus far.
|
|
|
Post by Tedmilk on Jun 4, 2008 2:56:28 GMT
Oh - another level-related question that's been puzzling the hell out of me: How in god's name is the starfield generated? Specifics would be lovely - does it reside in a single layer? Are random tiles created at runtime by dotting stars on a black background? does it repeat?
I'd love to know this!
|
|
|
Post by Mindless on Jun 4, 2008 3:32:44 GMT
all these answers are to the best of my knowledge -- they may be wrong 1. layers are independent (backPos2 is modified by backMove2, etc) 2. yes, ground enemies are indexed 25-49 and 75-99 -- always just above layer 1, air enemies are 0-24 and 50-74 -- these two air groups may be independently placed above or below layer 3 (and also below 2, possibly?) 3. the game is coded for 3 layers, some may be disabled for lower detail levels (level script can also disable them, I think) 4. stars are drawn in real time. each star has an x and y coordinate (though they're technically both stored in one offset value), a speed and color. initially, stars are placed randomly (with a random speed and color as well). stars that fall off the bottom of the display are recycled (their offset overflows)
|
|
|
Post by Tedmilk on Jun 4, 2008 4:55:32 GMT
Wow, thanks! The stars stuff - though it seems obvious - has helped me a lot.
The enemies stuff is going to be quite a challenge, as I am rendering all my layers first, then enemies, then player shots etc., all from separate arrays. I could have separate enemy arrays for each intended z-depth, but that's going to make hit detection a nightmare (it's already getting out of hand, what with checking through the multideimensional array of the players sidekicks, front/rear guns etc).
I'm hoping I'll even be able to do those fancy-shmancy background effects (waving stuff around w/palette changes, for example) using AS3's fancy new BitmapData functions.
Actually, that's a point - how are the transparent objects 'blended'? I mean, if you look at the clouds in my WIP they're nowhere near blue enough (and I've set the alpha value all over the place). Nope, something's different there I suspect.
I DARE someone to answer this post! Thanks again, Mindless.
|
|
|
Post by yuriks on Jun 4, 2008 9:36:41 GMT
Stars are a special case and are manually drawn on the background. As for the new questions: 1. Dunno 2. All enemies and collectibles are held in a single array. 3. Always three. Sometimes layer 2 or 3 is disabled tho. Also, you may want to take a look at OpenTyrian. (And wtf, post mess  )
|
|
|
Post by Tedmilk on Jun 4, 2008 11:43:57 GMT
Thanks, yuriks.
What do you mean 'post mess'?
|
|
sharp
Member
What?
Posts: 79
|
Post by sharp on Jun 4, 2008 18:44:55 GMT
I think he means that alot of the posts on the fourms are being deleted lately.
|
|
|
Post by Mindless on Jun 4, 2008 21:14:17 GMT
5. transparency is accomplished by using the hue and saturation of the upper layer and then blending the brightness of the two layers (Tyrian's palette is specially arranged to make this work)
|
|
|
Post by Tedmilk on Jun 6, 2008 4:13:03 GMT
Hmm... I suspected it would be something like that. It's a bit out of range of my programming skills, but I HAVE managed to get transparencies looking closer to Tyrian's by cheating a little; by passing a colorTransform object which not only has its alpha lowered, but also an increase in color - for the clouds in my demo, I increase the blue by 40 and the green by 10 (I haven't uploaded that version yet). The only trouble with this is that I'll have to do it for EVERY transparent object, but it's not that big of a deal.
Regarding progress on the starfield... I'm adding stars at random. They set their own coordinates as well as reduce their own brightness from maximum to a random value. When they reach the bottom of the screen these properties are all reset.
Thanks a lot, guys! I'll update you all if I make any breakthroughs.
|
|
|
Post by Tedmilk on Jun 11, 2008 7:28:47 GMT
UPDATE: Got the starfield working. I've also managed to get a displacementMap working for special background-warping effects as seen on Pentium detail level and above... Looks just like Tyrian (and makes the starfield flutter like snow - not that I'll be using it on the starfield).
I'm just trying to figure out how to get transparency working just like it works in tyrian - it's pretty much the only substantial visual effects hurdle I have left.
Anyone good with Flash as3? See Mindless' last post for what I'm trying to achieve.
|
|
|
Post by Tedmilk on Jun 11, 2008 11:13:44 GMT
God knows if anyone's reading this... to do transparencies like tyrian, would I be right in saying that I'd have to get the RBG values from the pixel below, find the difference between the RGB channels of that and the new pixel, divide the result by two and offset the new pixel's RGB by that amount?
Or, do I have to find the mean average of the lower pixel's RGB values beforehand, THEN find the difference between that average and the new pixel, divide the result by two and offset the new pixel's RGB by that amount?
Either way, it's looking like some major slowdown is in store!
|
|
|
Post by Tedmilk on Jun 28, 2008 21:18:55 GMT
OK, I now have the horizontal parallax scrolling up and running... got some nice enemy movements on the go, too (swaying back and forth, moving in an arc etc)... I WOULD like to know the following, however:
My enemies are now being drawn to the layers, with each layer updating its enemies with a new X-coordinate, after they've modified their own. I'm just wondering if the players weapons/pickups/explosions are rendered onto a layer... at first I thought they were just added to the screen and that was that, but as I noticed when shooting forward-firing rockets, their x-position changes in relation to the ship ever so slightly when it moves along the x-axis.
Are they drawn to an invisible layer, above the backgrounds? And if so, does this layer move on a set x-increment on every level? Also, how/where are the powerups and explosions rendered?
Once I can figure out the correct hierarchy for rendering, I can't see anything stopping me from getting a serious amount of work done - I might even have the thing finished in a few months.
Any questions welcome... or should I move this project to a different forum (since I'm building something rather than modifying Tyrian itself?).
|
|
|
Post by Mindless on Jun 29, 2008 21:41:27 GMT
My enemies are now being drawn to the layers, with each layer updating its enemies with a new X-coordinate, after they've modified their own. I'm just wondering if the players weapons/pickups/explosions are rendered onto a layer... at first I thought they were just added to the screen and that was that, but as I noticed when shooting forward-firing rockets, their x-position changes in relation to the ship ever so slightly when it moves along the x-axis. Are they drawn to an invisible layer, above the backgrounds? And if so, does this layer move on a set x-increment on every level? Also, how/where are the powerups and explosions rendered? Only certain player shots are affected by the player's ship movement, so they're not on a layer, they just have their position modified when the player moves. Power ups are actually enemies with a special 'pick up' value. I think there's a bug you can trigger (not sure how) on the boss of the first level of episode 1 that allowed you to pick up one of the boss's claws as a power up (though it didn't actually give you anything but credits for doing so). Explosions are not on a layer, but are drawn on top of nearly everything else (eg. they're below the level timer).
|
|
|
Post by Tedmilk on Jul 6, 2008 15:08:13 GMT
Thanks. I'm just trying to finalise my level code right now, simplifying and tweaking as I go. I've created my own fonts, so I'm really looking forward to doing the menus... I've still got sound and music to go too, but I reckon it should be easy enough (I'm composing my own tunes in fruityloops, too, which is pretty fun).
I'm really grateful for everyone's help by the way, you guys rock!
|
|