Results 1 to 10 of 87

Thread: Space Shooter Game Editor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Unfrtunately I havent been able to compile your project as I don't have all components so I can't offer you exact code changes: But becouse I was doing something similar once I can still give you some hints:

    1. Instead of creating all 1500x32 sprites create just as many sprites as it fits your window. Then you are only changing the sprites texture (Image).
    For instacne you define your map the same way as you do using:
    Code:
    TMap: array of array of Integer;
    Then you define multidimensional array of sprites:
    Code:
    TSprites: array of array of TSprite;
    And then when you move your map you just check which texture should be used for which Sprite like so:
    Code:
    Sprites[X,Y].Texture := Map[X+Left,Y+Top];
    2. Decrease the number of redraws as much as posible. Since you are making a map editor you probably don't even need 30 FPS. So increase the timers interval. Or even better if you are only using static Sprites (no animations) you can forget about constant redraws and actually fire redraws only when there has been any change. This can especially come useful when you are forced to render lots of Sprites (zoomed out view of your map for instance).

    NOTE: All the code examples are purely out of my head so there is great posibility that they have syntax problems in them.

  2. #2
    THANK YOU VERY VERY MUCH!!! I did it, after spending my day here in front of the computer, checkin DraculLin-s Diablo demo, and your advice, I did it. I'm using a 2d map array to store my map, and using a second array of sprites that is
    only as much as needed to fill my rendering surface 640x480 that is 20x15 of 32x32 tiles .

    I'm attaching the code for review, please note the Layer buttons don't do anything at all...neither does the delete... a few of them edits are for debuging .... gona clean up the code, and read layers, then I'll play with using Sprites on this map
    that actualy have animation , like water , lava ... or grass that moves....

    Greetings
    Robert

    ps.: if you try it, please post FPS , on my machine it has 1100 FPS , Core 2 Duo 7500 , Geforce 250GTS , wonder what it does on slower rig....
    Attached Files Attached Files
    Last edited by robert83; 29-12-2012 at 03:39 PM.

  3. #3
    On my laptop (Acer Aspire 6530G with AMD Turion X2 Dual Core 2.0 GHz, ATI Mobility Radeon HD 3650 512 MB VRAM) and Windows 7 I'm getting between 310 and 320 FPS when idle and between 280 and 290 FPS if I do lots of mouse movments which cause selection sprite to move to other tiles.
    The performance isn't affected by the size of the map so you did it.

    BTW you can use any visual component as Aspyhre renderning target. So you don't actually need to create a new form for renderning area but simply use TPanel component for instance. Offcourse having dedicated form is advised if you are making FullScreen mode game to gain aditional performance.
    The reason why I'm telling you this is becouse currently when I launch your program both form sizes exceed the size of my screen so I can't see whole program of yours.

  4. #4
    Thank you very much for the reply. Wow that is great, but how do I do that ? How do I specify AsphyreDevice1 rendring target? I've tried after ApshyreDevice1.Initialize; to add this , AsphyreDevice1.Create(Panel1); but nothing happens...

    Greetings
    Robert

  5. #5
    To be honest I don't know exactly as newest version of Asphyre had some changes in it. But based on the dfm file of your main form AsphyreDevice1 component which has been placed on your MainForm has property WindowHandle which is currently set to 0.
    I belive that changing this property to Panel.Handle should set Panel as rendering target for Asphyre but I'm not sure. You need to change this property prior the Initialization of the engine.

  6. #6
    Did some aditional progress meanwhile, ditched the combobox in favor of ListView, now I can display all them Tiles with Names besides them in a nice manner.

    Also added animated background tiles instead of static.... check out water water_1_1_ani.image,water_1_2_ani.image,water_2_1_ ani.image,water_2_2_ani.image , they are supposed to be assembled in a 64x64 tile...
    like

    Water1,1 ; Water 1,2
    Water2,1 ; Water 2,2

    And damn they move but look darn bad (did it myself... dang, I'm going to have to look for another nicer....way to animate water , that does not overwhelm me, this requires a far better artist then I.

    Anyway please check my latest and greates editor....

    Note : it was designed with 1920x1080 resoltion.

    Greetings
    Robert
    Attached Files Attached Files

  7. #7
    A few more advices:
    1. I see that you are treating every sprite as animation sprite now. This is OK but you don't need to have active animation for every sprite especially if it contains just normal picture and not animatio. Having active animation for sprite which contains just an image slows down everything becouse SpriteEngine still treats it as animation with 1 picture and since you are looping the animation it is always updating its image with the same image. So I recomend you to have active animation only for those sprites which are actually animated.

    2. In DrawLevel procedure you are calling this:
    Code:
    Used_Tile := Images.Item[map.data[i,j+Offset]];
                   BackGround[i, j].ImageName:= Used_Tile.Name;
    This can slow down everything quite a bit since you are searching for needed images using and Image name which can be quite slow.
    Why don't you search for the right image using its index.
    Doesn't TAnimatedSprite alows you to specify its image by directly specifying TAsphyreImage? If it does don't search for proper image using its name but simply specify its Index which should be the same Integer value as you are saving it in Map data.
    Code:
    //Note writen from my head
    BackGround[i, j].Image = Images.Item[map.data[i,j+Offset]];
    3. As for moving water animation the main problem is that you have those white lines which stands out to much. If they would be dark blue it would seen much similar to water than it does now. Infact now it loks more like a bunch of Blue bugs crowding in some place.
    Several picture editing programs low adding watery effect to the pictures so I suggest for you to check it ot if this is supported by your Picture editing programs and the use it. What you actually want is some constant waves movment.

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
  •