Shop OBEX P1 Docs P2 Docs Learn Events
New Game IDEA! :-need lead programmer for colors(256 or more) and controller: — Parallax Forums

New Game IDEA! :-need lead programmer for colors(256 or more) and controller:

edited 2007-06-08 12:54 in Propeller 1
Quantum lance 3D!:

Well, right now I have 8 of the 512 images for the sprite for the character(belive it or not, my job is so much harder than the people who plan to help me.) The reason it will use so many images for the sprites, is because I am implementing barrel roll. For the game I will take the scaling code from The X-Racer game, and make it use my sprites, get rid of the road, add the insane colors, make it allow for complex movement by joystick. And make the stars scale, also add movement through a more vast scale!

If anyone will help be the lead programmer for this idea/project, please speak. I'm the one with the hardest job, so don't be so intimidated by it. Also, this game will NOT fit in the 32 KB In fact, it doesnt' matter how much memory your code takes up, as long as it is not greater than a gig(which is highly improbable)

Comments? look at the attachment to see my current work

Note: This is only 1/64 of how many sprites I'll be making.
330 x 250 - 2M
52 x 52 - 503K

Comments

  • AndreLAndreL Posts: 1,004
    edited 2007-05-30 23:20
    Also, make sure to take advantage of symmetry and mirroring in code. For example, take a look at Wing Commander, it had 1/8th the images of the 3D sprites and generated the rest by mirroring, flipping etc. on the fly to save space and work.

    And don't totally commit to sprite or tile art for 3D, the propeller is definitely fast enough with a better graphics engine to do bitmapped 3D with filling. You just have to get rid of the per pixel onscreen test that the parallax driver uses to fill polys, take it out of the loop and the number of polys/second will go up quite a bit. Of course, you are stuck with 4 colors, BUT, once again, you can tile the color space, so each 16x16 screen space can at least have its own 4 colors. Then you can stick to a bitmap only display which is much easier to code than tile+sprites.

    Something to think about --

    Andre'
  • edited 2007-05-31 00:04
    I have no idea how to make a 3D model, the only things I know how to do when it comes to making this game, is implement the scaling for X-Racer and optimise it and add the·sprites I make, so, really, I'll only need 1/8th of the amount of sprites I'd be doing if I use flipping...But I have no idea how to flip them: As for colors, I'm not too good at it, Can you post an example of an edit of a program at the forums that can tell me how I can make the driver work for more colors?

    I need help on: 3D modeling for the Hydra,Colors,Joystick controller programming,Flipping of sprites and usage:

    Can you please tell me some data to get me started on some of the project?

    Thank you.
  • AndreLAndreL Posts: 1,004
    edited 2007-05-31 00:57
    IF you have the hydra, there is a free book I wrote on the CD "the black art of 3D game programming", its still used in many colleges as a text on 3D graphics algorithms. If you start reading thru it it shows how to do wireframe, shaded 3d, hidden surface removal, lighting, clipping, all that stuff. Its not hard at all really, all start with pixel, line, and polygon fills.

    Read my book, then try and make a simple 3D model rotate around on the screen, then try and model it as polygons with faces and normal vector, do a simple hidden surface removal algorithm, then up the tech with a sorting algorithm, painters algorithm is fine for this stuff, then you get a "camera" system working and you have a rudimentary 3D engine something like that was common in the late 80's early 90's.

    OR you can try a "ray casting" engine which I cover as well in the book which is the approach wolf3d takes.

    Andre'
  • edited 2007-06-01 02:20
    I have the Hydra and the book, I had read that chapter on 3D but there are Zero examples in there, the only example I have is the wireframe 3D demo that I'm not sure how to edit and fill in colors into the lines.

    I'll probabilly be able to get rid of the road and change it to stars and stuff, then add sprites that scale elsewhere on the screen, but to start, I need Code examples on Flipping sprites,A simple Scaling code (derived from X-racer)A simple 256 color obj(derived from the "Glass" demo) and the Keyboard·obj that uses one cog.

    I have the following: The keyboard object,some sprites,Sound concept(in progress)

    I need the following: 256 Color obj,Simple scaling code,sprite flipping demo/obj,hueing demo/obj

    I will be able to do these: Simple scaling code,256 color obj(possibly)

    I need help on these: Hueing,Color and Sprite flipping

    progress:= 6%

    ·As for the 3D model, I will try it out and see if I can get anywhere.

    Thank you alot Andre!
  • edited 2007-06-05 22:18
    I'm still reading the book about the 3D models...If only I had a C to Spin compiler...

    Will you give me some examples for hueing code,flipping code and simple scaling?

    As for sound, I know exactly what I'll do, but It seems I'll have to wait to get the sound into HDMF format.

    Please help!
  • JT CookJT Cook Posts: 487
    edited 2007-06-05 23:39
    I don't think a C to SPIN compiler will do any way because the platform you are getting the C code from (PC) is completely different than the platform is being developed on (Hydra).

    Also it sounds like you are starting out with too big of a project. Start smaller, make a pong or tetris or pacman first. Also you are not going to get more that 60 some colors out of the Hydra, that limit is fixed.

    Start off using Andre's video driver and make a game. Then learn asm and make your own video driver that meets all the needs you are looking for. No one else is going to do any programming for you outside of code that has already been released.

    Just remember, start smaller. Make a Pong.
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-06-06 02:44
    I wrote a wire-frame 3d engine for a CGA graphics game I wrote many years ago. I'm re-writing its core algorithms for the Propeller, and I've figured out a fast polygon fill technique that generates solid-color polygons using a variant of the same algorithm I used to draw lines in the original wireframe version. It will be a few months before I have anything to release, but when I do you will be welcome to reuse it for your games - my engine will be open source under GPL.

    I'm calling it the */ ("star slash") 3-d engine.
  • JT CookJT Cook Posts: 487
    edited 2007-06-06 04:47
    That is cool. I was wondering if you could describe the routines you are using for polygon filling? I'm really looking for the SPIN code, but just routines/math that you are using to draw/fill polygons. That is something I want to start messing around with (tho probably in C on PC instead of on the Hydra).
  • edited 2007-06-06 17:08
    AHH! D: Eh, I accidentally ignored the guy after you, can you tell me his name?

    Also: Can I use the engine when your finished? and: Do any of you have some simple scaling,sprite flipping and raycasting code examples·or hueing code examples?
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-06-07 02:41
    Sure! When I get time I will be posting onto my website a detailed explanation of each part of the engine as I finish it, but right now I've got too much on my plate to devote to that. I try to give you a short explanation of how the triangle drawing works right now.

    Edit: An important point for understanding what follows is that the edge of a triangle, and a line, are the same thing. The key idea is that if you know how to draw a line, then you know how to draw a triangle.

    Let's say you draw the whole screen scanline by scanline (the way a TV driver works). Suppose you are drawing a scanline that passes through a triangle. What you want to know, in order to fill in the right pixels, is what X coordinate the leading edge of the triangle crosses that scanline at, and what X coordinate the trailing edge intersects the scanline. If you color in the pixels of the scanline between the leading edge and the trailing edge, then you correctly color in one horizontal slice of the triangle on each scan.

    A simple way to do this is to use math to figure out where the lines intersect. You can figure out the slope of the line using "rise over run," in other words taking the x distance traveled and dividing by the Y distance traveled between your two line endpoints; that's your rise over run, your slope. Once you have the slope, you can start with one endpoint and figure out the X location that it intersects it by multiplying the Y distance between the scanline and the endpoint, by the slope. The thing is, this is slow because it involves a divide and then a multiply; it's inefficient to do that on every scanline.

    You may notice that a line moves a regular amount of pixels left or right as it goes along. Instead of recalculating the slope and intercept every time, it is much faster to re-use the value of the last intercept and add a constant to it to get the new intercept. Once we have a starting line endpoint, we calculate the slope value one time, and we find the x-intercept for the next scanline by taking the last value and adding just a small incremental value to it (the slope of the line over just one Y increment). This is very similar to the Bresenham line drawing algorithm, except that it is even simpler. In order to draw a line, you have to figure out which of the four quadrants you are in, and whether the line is more vertical or horizontal. But to draw a triangle, you simply generate "enter" and "exit" locations for the leading and trailing edge, and it doesn't matter if the edges are sloping forward or back, or more or less than 45 degrees, it will still get filled in correctly.

    Overlapping triangles can be handled like this: you precalculate all of the "enter" and "exit" points for the triangles, and put them into a list. If you want to impose a Z-ordering or the painter's algorith, you can then juggle the points in the list to get whatever draw order you like. Whether or not you apply Z-ordering, you then pass the enter-exit list to cog running a finite state machine scanline renderer with a special stack. Whenever it encounters an "enter" symbol, it pushes that triangle's ID onto the stack. When it encounters an "exit" symbol, it searches the stack and removes that triangle's ID (it may be or may not be the topmost one on the stack). Any time it needs to draw a pixel, it looks at it's stack and draws the color of the topmost triangle on the stack. If it runs out of triangles on the stack, it draws a background color (such as sky or stars).

    This may be fast enough to generate TV output directly from a triangle list without any intermediate bufferring (saves you the RAM usually required for a screen buffer).
  • JT CookJT Cook Posts: 487
    edited 2007-06-07 04:24
    That is pretty interesting. I have never tried to draw any filled polygons, but have thought how that would be done. I keep thinking as a whole screen I'm like "Where do I start the fill and what do I do fill it" but taking it a scanline at a time makes a lot of sense (why not, I did the same thing for sprites?).

    Also your render sounds interesting because in theory you could run it at 60 FPS since it is rendering on the fly, it would just run at the speed of the 3D calculations for the list.
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-06-07 05:21
    Another neat optimization is to render to a temporary buffer, and display TV out of that buffer. You could have two or three scanline buffers; it would be just like double buffering or triple buffering in computer games, but only for one scanline so memory usage would not be high. Instead of displaying directly off the triangles, you achieve more horsepower by using two separate cogs - one to render and one to drive the TV. Now, suppose you are triple buffering scanlines and the renderer gets bogged down (too many triangles on one line). What happens is that the next scanline in the pipeline is not ready for the TV driver when it wants it - but since we are triple buffering, we have some time gap between where the renderer is and where the TV is. What we do is we go ahead and finish rendering the scanline (late), and in the meantime the TV driver still has one more prerendered buffer to consume (this is why we are triple buffering, not just double buffering). Now, we could go ahead and render the next scanline and *hope* we pick up the speed and outpace the TV driver. But if the last scanline was too full, it's likely this one might be like the last.

    So instead of rendering the next scanline, we SKIP the next scanline and render the one after THAT! In one swoop we recoup our speed losses and regain our triple buffering. But what does the TV driver render when it catches up to the scanline we skipped? It goes back and displays the old scanline pixels over again! Will you really notice one line of doubled pixels in a busy image? The algorithm degrades gracefully - at best you can operate near peak triangle capacity all the time with very little glitching. At worst, the whole display drops down to one-half normal resolution but nearly doubles "max" triangle throughput!
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-06-07 10:55
    Hi Dennis,

    It seems like we've been thinking on similar lines. Although it sounds like you're taking a top down approach, and I'm taking a bottom up one.

    To me and I think you too, The Hydra Way is never to use screen buffers, and always to generate scanlines on the fly. That mitigates the Hydra's weak point - lack of memory, and leverages it's strengths - multiprocessing, and software generation of the TV signal. So I've got a nice TV driver and renderer object pair that's adaptable to any type of graphics output.

    Fantasia isn't really intended to be a text TV driver at all. I just did text as the first output to facilitate future debugging needs. The idea is to produce a hi-color vector driver. So the plan is bitmaptext->particles->vectors->vectortext. That much I'm definitely going to do. But of course once you've got vectors, then wireframe 3D becomes quite tempting. And filled triangles are also a logical progression from drawing lines. I'm not sure that I'll progress to 3D, but I might not be able to resist the temptation.

    As both yourself and Andr
  • BaggersBaggers Posts: 3,019
    edited 2007-06-07 11:30
    Seems we've all been thinking the same lines.
    Dennis, I've been thinking about·making a TV display driver for rendering.
    I'll do a prototype, and post it.
    See how it looks.

    Baggers.
    ·
  • edited 2007-06-07 13:28
    Good ideas! but, I seriously need code examples now that I see some examples of what I'd need to do.
    I'm a bit confused with the Hydra really, but if you would give me code examples for those, well...I bet I probabilly could get more work done!

    What I need is Code examples for the following I said before,explanation of each code example, so I can finish the code examples and make them slowly more advandced to work with what I'm doing.
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-06-07 14:35
    Bob,

    You said something about accidentally ignoring JT Cook! Well that's a shame because he gave some good advice for you. I'll repeat it for you.
    JT Cook said...
    I don't think a C to SPIN compiler will do any way because the platform you are getting the C code from (PC) is completely different than the platform is being developed on (Hydra).

    Also it sounds like you are starting out with too big of a project. Start smaller, make a pong or tetris or pacman first. Also you are not going to get more that 60 some colors out of the Hydra, that limit is fixed.

    Start off using Andre's video driver and make a game. Then learn asm and make your own video driver that meets all the needs you are looking for. No one else is going to do any programming for you outside of code that has already been released.

    Just remember, start smaller. Make a Pong.

    It's good advice. You're asking for advice and code snippets for rather a lot of the things that you need to do for a 3D program. Which means that you're probably aiming too high for your first project. You have to start simple and work up. Pong is a good idea, or breakout, or for more of a challenge, Space Invaders or Pacman. But you certainly don't want to be starting out doing a 3D game if you don't already know how to do a 3D game AND have a very good grasp of multiprocessing and the Propellor chip
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-07 16:34
    Bob, to un-ignore JT; click on the "Control Panel" button in the upper left hand corner of the page, click on "Edit Ignored Users" in the upper right of the page, then hit the X next to JT's name and his messages will reappear.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • edited 2007-06-07 20:30
    Eh, Paul I allready did that but thanks anyways! And, I know that JT Cook said I should start simple, but I sort of feel like starting at something hard for me and then going to something simple so I can have a better grasp at complex things later, but when it comes to starting off Andre's video driver I certainly agree!

    All I need is an examples and some explamation of code·for me to get more than just sound and sprites/modifications done.

    Soon I'll show you a program for the music I've got!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Realize that I am really a mad scientist··· and


    Don't forget it!

    http://raydillon.com/Images/Illustration/GameArt/WildIsle/WildIsle-Ink-ScientistClose.jpg



    Post Edited (Bob the Builder on a C64) : 6/8/2007 2:57:46 PM GMT
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-06-08 04:49
    Bob, starting off with a big project and breaking it down IS a valid learning approach. I'd recommend taking an existing game and modifying it to make it do something else; that way you can start with a working program, so that it's easier to see the results of your changes.
  • edited 2007-06-08 12:54
    But thats exactly what I'm doing! I just need code examples for the things I want to add to it. then I'll modify the code examples so they will work with my modification! I'm using The X-racer demo as a starting point then making it be space, and adding camera view and etc.

    What·I need is examples in order to implement that stuff. pretty much, but it seems potatohead has the 400 color thing now..so I think I'll use that if I can!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Realize that I am really a mad scientist··· and


    Don't forget it!

    http://raydillon.com/Images/Illustration/GameArt/WildIsle/WildIsle-Ink-ScientistClose.jpg



    Post Edited (Bob the Builder on a C64) : 6/8/2007 2:57:56 PM GMT
Sign In or Register to comment.