Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Delphi XE3 , Asphyre Sphinx 3

  1. #1

    Delphi XE3 , Asphyre Sphinx 3

    Hi everyone, I've done some basic programing in Asphyre 3.1 on Delphi 7, now I'm trying to get up to date with the latest one, but since this uses no components at all, the help file is like non-existent. I'm overwhelmed by it. Can anyone give me a few samples of how to startup a simple program in fullscreen for example, load stuff from the asdb archive ? The examples that come with it seem overwhelming, I need all that stuff JUST to initialize a simple full screen app? Sorry for some reason I can't do a [ENTER] inside this dang window (today nothing works). Greetings Robert

  2. #2
    Hi robert. Wecome back

    Yes Asphyre Sphinx does require more code to initialize. The reason for this is the fact that it now supports DirectX (ranging from DX9 to DX11) and OpenGL providers.
    And of course Asphyre Sphinx 3 also has support for full 3D graphics.

    I suggest that you take a look at provided Examples again to get better idea of how it works.
    Documentation is now saved in several different html files. I suggest opening index.html in Helf folder which is starting page for Asphyre Sphinx 3 documentation.

    You will realize that rendering 2D content on Asphyre Sphinx is quite similar to the one from Asphyre eXtreme. The only drawbac is that there is no premade Sprite Engine for Asphyre Sphinx. So to learn how to render 2D content you might even wanna check the base souce code from Aspyre eXtreme Sprite engine.


    Anywhay after the 3rd PGD challenge is over I might be able to lend you a hand again.
    But until then I'm trying to devote that litle of free time I have to finishing my entry which unfortunately doesn't go prety well.

  3. #3
    Hi , thank you!

    Well after the timer issue with my previous project and some other stuff I was off for a while. But I feel like trying this again, I will eventually succeed in finishing at least a simple game once.

    Anyway I've started experimenting with Asphyre Sphinx 3 , hate this feeling, I feel overwhelmed, don't know where to start etc... pfffff. Anyway I've decided that I'll update this post regularly with my findings, I'm planning to redo my previous (unfinished ) editor in this engine perhaps with more success.


    The examples are a bit to much for my taste...but one can't expect the creator of the engine to make a step-by-step example for people, you are supposed to learn it or find another hobby. So what I did is, I've created my first test which is the first in a series of step-by-step tutorials for more complex stuff.

    Right now what it does is, initialize the engine in full screen with 640x480, uses Sprite Engine (by Gutya, thank you!!!) , it loads one image from the archive file, creates one sprite that can be moved around with the mouse on the screen. Using ESCAPE you can exit the program. Not much, but for the very first very basic step it's something.

    Greetings
    Robert
    Attached Files Attached Files

  4. #4
    Hello, finally after some long time, I've got some free time again on my hands to start experimenting. I'm playing with Ashpyre 3 , my problem is can I use for map editor something like this :

    ADevie1.WindowHandle:=Panel1.Handle;

    I've tried looking for It but can't seem to find it.

    Greetings

  5. #5
    Hi Robert! Welcome back

    To change to which component will Asphyre Sphinx 3 render you need to use code similar like this:

    I quickly modified code of the Basic example which comes with Asphyre Sphinx 3 so that it renders to Panel1 instead of directly rendering to the MainForm. I have left original code lines as comens so you can easily see what was changed and how.
    Code:
    procedure TMainForm.OnDeviceInit(Sender: TObject; Param: Pointer;
     var Handled: Boolean);
    begin
     //DisplaySize:= Point2px(ClientWidth, ClientHeight);
     DisplaySize:= Point2px(Panel1.ClientWidth, Panel1.ClientHeight);
     //GameDevice.SwapChains.Add(Self.Handle, DisplaySize);
     GameDevice.SwapChains.Add(Panel1.Handle, DisplaySize);
    end;

  6. #6
    Hello, thank you

    Hopefully I will get somewhere now. Right now I'm having a heck of a time again with loading AsphyreImages from asvf into TBitmap :

    Code:
          ImageTemp:=GameImages.Image[GameImages.Items[i].Name];
    It does not work obviously because ImageTemp expects TBitMap , but gets TAsphyreImage ... is there a simple solution for this ?

    Greetings

    update :

    think I will just cheat,since I'm planning to use fixed tiles, they won't change ... I'll just use ImageList 's to store tiles for the editor , and will use It like this :
    Code:
    procedure TForm1.DisplayAvailableTiles( TileSet : string );
    var i,j : integer;
        MyType : string;
    begin
      j:=0;
      // fill up listview with images
      for i:=0 to GameImages.ItemCount-1 do
        begin
          MyType:=copy(GameImages.Items[i].Name,0,4);
    
          if MyType = TileSet then
            begin
              if TileSet = 'Land' then ListView1.SmallImages:=TileDesert;
              if TileSet = 'Ocea' then ListView1.SmallImages:=TileOcean;
              ListView1.Items.Add.Caption:=GameImages.Items[i].Name;
              ListView1.Items.Item[j].ImageIndex:=j;
              j:=j+1;
            end;
    
         end;
      
      // set index to 0
     ListView1.ItemIndex:=0;
    end;
    it might not be the best solution but works nicely... now using a combobox , I can display tiles per category :

    -DesertTiles , OceanTils , DebrisTiles etc...
    Last edited by robert83; 24-02-2014 at 08:52 AM.

  7. #7
    Hello,

    [ Did not have much time to work on this editor thing,because I had to finish a database program that showcases (sorta) my knowledge , so that I may finally get a IT related job here in Germany ...]

    Anyway some update, I've been banging my head against the wall , because with my new editor layers 0 and 1 did not work properly , example, I've put a transparent shore tile on Layer1, then I've put an Ocean tile on Layer0 , the Ocean tile would be on top of the shore one, I've looked at the damn code for hours what could be wrong, even created a stringgrid for all arrays to display raw tile names.

    And then I found this in AsphyreSprite.pas

    Code:
      constructor TSprite.Create(const AParent: TSprite);
      begin
        inherited Create;
        FParent := AParent;
        if FParent <> nil then
        begin
          FParent.Add(Self);
          if FParent is TSpriteEngine then
            FEngine := TSpriteEngine(FParent)
          else
            FEngine := FParent.Engine;
          Inc(FEngine.FAllCount);
        end;
        FX := 200;
        FY := 200;
        FZ := 0;
        if Z = 0 then
          Z := 1;
        FWidth := 64;
        FHeight := 64;
        FName := '';
        FZ := 0;
        FPatternIndex := 0;
        FDoCollision := False;
        FMoved := True;
        FEffect := beNormal;
        FVisible := True;
        FTag := 0;
      end;
    see ? if Z = 0 then Z := 1; god dammit ...anyway back on track now, once the editor progresses as far as the other one with older Asphyre I will post it here along with source and all...

    Greetings
    Robert

  8. #8
    Since I don't have source code for this newer version of Asphyre Sprite Engine I'm asuming that Z is z order property of TSprite which determines which sprites are rendered on top. Also I'm asuming that FZ is internal vriable for storing Z property value.
    Now the
    Code:
    if Z = 0 then Z := 1;
    seems realy strange since accessing class property from within a class methods could lead to big problems (infinite loops) and should be therefore avoided if posible or used only for reading the property value.
    But what caught my eye even more is that in the code variable FZ (probably internal variable for storin Z property value) is set to 0 twice. Once right before that "if Z = 0" code and again a few lines below. This completly nullifies the efects of "if Z = 0" part of code and FZ is always 0.

    What happens if you change the Z property after the Sprite has already been created (set Z of Shore sprite to 1 and ocean sprite to 0 or maybe oposite)?

  9. #9
    Hello, so I did a bit further into this re-creatin...and I've hit the same problem with scrolling, I don't know what I'm doing wrong, but this MUST be me, since both Asphyre Extreem and this Asphyre 3 have demos with Smooth Scrolling and there it's all fine...
    What I did now, is I have a fullscreen app that loads all the tiles at once , and then on processevent (which is supposed to be running at constant speed executes it...)
    Well I still feel it is no smooth (guess this is what seperates the men from boys) .

    Attached is the source code, with all resouces ,and compiled exe , that automatically loads masodik.map file and scrolls trough it. (yeah, I've draw all my tiles.... )

    Please enlighten me what am I doing wrong, this is driving me crazy.

    Greetings
    Attached Files Attached Files

  10. #10
    Fast reply...WOW!

    I switched to OpenGL... It is scrolling smoothly now, why? I checked multiple speeds it is fine , I have only one problem, OpenGL 640x480 does not stretch to full screen , why?
    If need be I'll go use OpenGL instead.... don't plan to use any special directx effects...just trying to learn somthng...and pass some time till I get some job in Germany (which is harder then I thougt , cause I don't have any IT degree, and even though I've created a quiet nice database program for vehicle management as a demonstration of my skils, and I do know a thing or two about Linux ... I feel they don't care...sh*t... , my life NOOOO.... sorry drifted a bit of)

    Edit : DirectX9 is also smooth, it just hit me, DirectX7 is some kind of weird software rendering thing.... anyway please take a look at my source doing the scrolling like that in processing is correct?

    Plan : map scrolls down.... enemies appear later based on Layer 4 or Layer 5 , a few enemy types.... follow player...random movement shoot down etc...

    Nothing fancy...just make something very very basic...

    UPDATE 2 : still happens not as often though...I hate my life
    Last edited by robert83; 09-03-2014 at 09:53 AM.

Page 1 of 2 12 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
  •