Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 62

Thread: 4E4 Contest Entry - Unnamed RTS

  1. #21
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    4E4 Contest Entry - Unnamed RTS

    Ok - took the DLL from JEDI-SDL ver 1 and it works properly now.

    Thansk a lot MSX. Now I just have to try understand what was done.

    I'll also first add a FPS count so that I can see the difference.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  2. #22
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    4E4 Contest Entry - Unnamed RTS

    I added an FPS counter and got 186 when I ran the program A bit better than the 30 I was getting from my code.

    Now I need to convert my S2DL units to use OpenGL.

    How do I draw a small portion of an image tot he screen? I have png files that contain full sets of Sprites.

    How do I define a transparent color per image?

    How do I create a temporary surface on which to do a drawing? I want to create the current background on a surface and blit this to the screen and only update it when the background needs to change.

    I'm sure there are going to be a pile more questions before this is done

    My goal is not to change my interfaces into my S2DL units - this will allow me to just recompile game like Run-A-War and make them use OpenGL.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #23
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    4E4 Contest Entry - Unnamed RTS

    Ok - got drawing a portion of the image to the screen.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  4. #24

    4E4 Contest Entry - Unnamed RTS

    Quote Originally Posted by cairnswm
    I added an FPS counter and got 186 when I ran the program A bit better than the 30 I was getting from my code.
    very well
    [quote]


    >How do I draw a small portion of an image tot he screen? I have png files that contain full sets of Sprites.

    Just act on the glTextCoord on the DrawRectangle.

    >How do I define a transparent color per image?

    More than a transparent color you should use the alpha channel. If you look at the pointer.png image, you'll see that it have an alpha channel that makes the background trasparent (0).
    BTW this let you have continuos alpha values, not just 1 or 0. You can have 50%, 30% etc on different portion of the same image..

    >How do I create a temporary surface on which to do a drawing? I want to >create the current background on a surface and blit this to the screen >and only update it when the background needs to change.

    Umm you should generate a texture at runtime. This is not very easy as all textures must be squared. So you should map the screen on a large texture (1024x1024). Once you create the texture, you should use some Render-to-texture tecnique, and then use the generated one for the background.

    >My goal is not to change my interfaces into my S2DL units - this will allow me to just recompile game like Run-A-War and make them use OpenGL.

    Well, probably you'll have to change something.. But if it's done well there will be only minor changes.

    Bye!
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  5. #25
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    4E4 Contest Entry - Unnamed RTS

    Thanks MSX

    Just got the Transparency work well - using the Alpha Channel (Thank Goodness for TheGimp).

    So what is the render-to-texture technique?

    I dont mind having to create a 1024/1024 texture if it will let me get a faster blitting working.

    Can I use SDL_ttf and SFont with the OpenGL stuff or is there another Font component I can use?

    I almost have my template working again. Except for background and Text I have been able to encapsulte everyting in my S2DL units and will not have to change any code in the main programs.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  6. #26

    4E4 Contest Entry - Unnamed RTS

    Quote Originally Posted by cairnswm
    Thanks MSX

    Just got the Transparency work well - using the Alpha Channel (Thank Goodness for TheGimp).
    The gimp is simply great
    The best graphic program ever!
    So what is the render-to-texture technique?
    Well there are lots of different tecniques to do "render to texture" (that is, you render on a texture instead that on the screen, and then use that texture for the rendering)
    Here's a ]http://developer.nvidia.com/object/gdc_oglrtt.html[/url]

    Anyway entering "opengl render to texture" on google gives you lots of good answares.
    I've never implemented this becouse i never needed it. Don't know how much impact it can have..

    Can I use SDL_ttf and SFont with the OpenGL stuff or is there another Font component I can use?
    Savage and me did some experimenting on running SFont.. you can probably find the post by him.
    The problem is again with squared textures, since SFont expect straight font bitmaps.
    In the program savage generated a texture for each word the program have to display. This is good if you have fixed text, but for dynamic text it's not good.
    I thought about reading the straight bitmap and then for each character generate a small (32x32 or so) texture. This solution should work with bitmap variable size fonts (that was what i was searching when we experimented).

    Alternatively, if you have fixed size font, you can create your own font texture and some functions that find the characters and render them. With fixed size fonts this is quite easy (you can find this in any of my programs)

    I almost have my template working again. Except for background and Text I have been able to encapsulte everyting in my S2DL units and will not have to change any code in the main programs.
    Great, that's already more than i thought
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  7. #27

    4E4 Contest Entry - Unnamed RTS

    Quote Originally Posted by cairnswm
    Can I use SDL_ttf and SFont with the OpenGL stuff or is there another Font component I can use?
    Under the SDL_ttf directory, there should be an OpenGL demo of one way to render true type text using OpenGL.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  8. #28
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    4E4 Contest Entry - Unnamed RTS

    Version 0-03 - Converted to OpenGL and Added a Cursor



    Converted all graphics routines to OpenGL - this was a bit of a nightmare but in the end I got everything converted. Images were modified (thus included again).

    The minimap had to be a factor of 2 so the map size has been downgraded from 100x100 to 64x64 but its still quite big enough.

    Added a Nice sword as a mouse cursor.

    Download the game so far from http://www.cairnsgames.co.za/downloa...es/rts0-03.zip
    Download the source from http://www.cairnsgames.co.za/downloa...source0-03.zip

    The source will need the EXE images to be able to run.

    There are in fact very very minor changes in the way the program was written from 0-02 to 0-03 and the OpenGL calls. In fact only the code for the mini map and the removal of a predrawn background (I draw each tile now) were required - all other changes were done in my Images unit (S2DLImage for those looking at the code).

    My thanks to Savage and MSX for thier help over the last few days.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  9. #29

    4E4 Contest Entry - Unnamed RTS

    Well done William, scrolls very nicely on my laptop.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #30

    4E4 Contest Entry - Unnamed RTS

    Well done!
    I tryed to compile it under linux and it went with little changes.. You could consider to correct some things to make it linux compatible.. I'll make lots of people happy
    Here's a screenshot:



    PS 180 fps .. not bad
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

Page 3 of 7 FirstFirst 12345 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •