Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 67

Thread: PyroGineび「 Game Engine

  1. #31

    Re: PyroGineび「 Game Engine

    Quote Originally Posted by PyroGine Development
    Ahh ok I see. There is one in fact called DelphiDoc, which I tried, but I was getting AVs. I will check out PasDoc too.

    On another note I just updated the PGNet unit with a new class that support network object persistence. I simply derived a new class from PGNet, override the OnRecive event handler to handle processing objects, finally added a new event handler to received the object rather than the data pointer and size. Now you will be able to send live objects across the wire.

    Deceleration
    [code=delphi] TPGNetObjects = class(TPGNet)
    protected
    FPersistence: TPGPersistence;
    procedure OnReceive(const aHost: TPGString; aPort: Integer; aData: Pointer; aSize: Integer);
    public
    constructor Create; override;
    destructor Destroy; override;
    procedure OnReceiveObject(const aHost: TPGString; aPort: Integer; aObj: TPGPersistentObject); virtual;
    end;
    [/code]

    Implementation
    [code=delphi]procedure TPGNetObjects.OnReceive(const aHost: TPGString; aPort: Integer; aData: Pointer; aSize: Integer);

    function GetObject(aData: Pointer; aSize: Integer): TPGPersistentObject;
    var
    stm: TPGMemoryStream;
    begin
    Result := nil;
    if aData = nil then Exit;

    stm := TPGMemoryStream.Create;
    try
    stm.OpenBuffer(aData, aSize);
    Result := FPersistence.LoadObject(stm);
    finally
    PG_FreeAndNil(stm);
    end;
    end;

    var
    obj: TPGPersistentObject;
    begin
    // check if incoming data has a possibly valid persistant object
    // signature
    if (aData <> nil) and (aSize > FPersistence.ObjIdSize) then
    begin
    // try to get object instance from incoming stream
    obj := GetObject(aData, aSize);

    // if we got a valid object then pass it to the event handler
    if Assigned(obj) then
    begin

    // call event handler
    OnReceiveObject(aHost, aPort, obj);

    // free object
    PG_FreeAndNil(obj);
    end;
    end;
    end;

    constructor TPGNetObjects.Create;
    begin
    inherited;
    SetReceiveEvent(OnReceive);
    FPersistence := TPGPersistence.Create;
    end;

    destructor TPGNetObjects.Destroy;
    begin
    PG_FreeAndNil(FPersistence);
    inherited;
    end;

    procedure TPGNetObjects.OnReceiveObject(const aHost: TPGString; aPort: Integer; aObj: TPGPersistentObject);
    begin
    // handle received objects here, override for your own derived classes
    end;[/code]
    Very nice

    cheers,
    Paul

  2. #32

    Re: PyroGineび「 Game Engine

    I've released v0.4.0 developer version. The developer version is the current work-in-progress daily build that will eventually become the next stable release version.

    Changelog
    (4/19/2010):
    [*]Added command-line PyroGine Pascal Compiler (pgpcc.exe)[*]Added embeddable script compiler (TPGScript, Pascal, Basic and JavaScript syntax)[*]Added support for loading and using DLLs stored in an EXE as RC_Data (PG.ResourceLoadLibrary, PG.ResourceFreeLibrary, PG.ResourceBindToPro).

    Also, join me on Facebook and Twitter.
    Jarrod Davis
    Technical Director @ Piradyne Games

  3. #33

    Re: PyroGineび「 Game Engine

    Nice work Jarrod

    OT:
    I am so angry with myself

    I have had nothing but trouble today...

    1. I got onto the bus to go to work, pulled out my mp3 player, and found it was all scratched up - I hadn't put it back into it's protective sleeve, and stuff in the front pocket of my bag scratched the front of it - totally my own fault, but D'OH!.

    2. I got to work, pulled out my 8GB USB key, put it into the computer, and tried to access some stuff from it. The computer politely informs me that it isn't formatted, and do I want to do this now...

    It was fine yesterday, but it now looks like I have lost everything that was on it, including my PyroGine project "The Probe"! Again, my fault for not backing it up onto the hard-drive, but still...AAARRRRRGGGGGHHHH!!! I do have some older code for the game elsewhere, but I have lost the shiny new code I wrote in the last couple of days when re-factoring the game...

    I wonder what ELSE will go wrong today (seem to come in threes?)

    cheers,
    Paul

  4. #34

    Re: PyroGineび「 Game Engine

    That's a bummer man!

    Fortunately, It takes less time to re-write that code, because you probably remember what stuff you added/changed. Just do that ASAP, so you don't forget. Also, harddrives are alot safer for storage. I have 2 USB-sticks but I don't use them that often (I use google docs, SVN and SSH (on linux) alot, so I dont have to carry my stuff with me).
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #35

    Re: PyroGineび「 Game Engine

    Quote Originally Posted by chronozphere
    That's a bummer man!

    Fortunately, It takes less time to re-write that code, because you probably remember what stuff you added/changed. Just do that ASAP, so you don't forget. Also, harddrives are alot safer for storage. I have 2 USB-sticks but I don't use them that often (I use google docs, SVN and SSH (on linux) alot, so I dont have to carry my stuff with me).
    yeah, I'd better re-do it ASAP so I remember it as best as I can. Mind you, it wasn't working completely so I might rewrite it anyway

    cheers,
    Paul

  6. #36

    Re: PyroGineび「 Game Engine

    Sigh. I know this all too well myself. Now my main dev box is mirrored to my external drive and backed up off site. A smaller external drive gave up the ghost recently and there where very important files on it that I had failed to copy off.... yea... one of those &^%$#@#% moments. I found this program called ZAR (Zero Assumption Recovery) that allowed me to successfully recover all my data. Phew! From what I understand it will work with USB drives too. Paul I hope you're able to recover your data.

    On a different note... a new daily update to PyroGine Game Engine v0.4.0 developer version has been posted.

    [*]Added light-weight IDE for PyroGine Pascal Compiler[*]Added PyroGine Pascal Examples

    Now out of the box you have:[*]Delphi 5+ higher support (full oop)[*]C++ Builder 2010 support (full oop)[*]Standard C++ support (api)[*]Embeddable scripting (Pascal, Basic, JavaScript)[*]Object Pascal + standalone IDE
    Jarrod Davis
    Technical Director @ Piradyne Games

  7. #37

    Re: PyroGine™ Game Engine

    Hi Jarrod,

    I've been looking into PyroGine for the Ludum Dare competition. I have some trouble getting the demos to compile though. I use Delphi 7 and many of the Pascal demos include this line {$RCDATA uOptionsForm.dfm} (in unit uOptionsForm). Delphi unfortunately comes up with an invalid compiler directive: RCData error. Is this because the demos in the pascal directory are actually for Freepascal and not Delphi?

    I remember having seen the next question before (I think Paul asked it too) but I cant seem to find it anymore. How do I make text visible? I see things like 'PG.Font.Draw(3,3, 1.0, PG_White, rsImage, fjLeft, '%d fps', [PG.Timer.Framerate]);' in the sourcecode, yet none of the demos actually display any of the texts.

    Thanks,

  8. #38

    Re: PyroGineび「 Game Engine

    Hi,

    All the sources in the pascal folder are meant to be compiled with the commandline compiler/ide. There are/will be extensions that are not available in Delphi/Freepascal. The RCDATA directive for example allows you to easily embed RT_DATA into your EXE/DLM file. This is currently used to bind .dfm data inside to exe for use with forms. RCDATA will be an extended form of the normal $R compiler directive. All the code in the delphi folder will/should compile in Delphi 5 and higher.

    PG is a global application object like the global application object in Delphi. It holds singleton objects such as the display device, render device and for convenience a default proportionally spaced console font which can be used for debugging. To load new fonts you can create an instance of TPGFontSTudio, load and render your fonts. Since fonts are textured objects, the DrawXXX methods must be used between RenderDevice.StartFrame and RenderDevice.Endframe methods.

    Make sure you have the latest dev build (v0.4.0) and load up the delTestbed project in D7 and it should compile and run. You have to add the sdk folder to the Delphi path so those files can be referenced. See uRenderDevice.pas in examples/delphi to see how to setup a minimal render loop that will simply display the frame rate.

    So, examples\delphi should be used by native Delphi , examples\pascal should be used by pgpcc/pgpdev. You can use pgpdev to make scripts/dlms for access from your native code if you wish or use it to make the whole app since it can generate EXEs. PyroGine.dll still has be present along side the EXE however.

    Let me know.
    Jarrod Davis
    Technical Director @ Piradyne Games

  9. #39

    Re: PyroGineび「 Game Engine

    Also in most of the examples you wont see StartFrame/EndFrame because they are using the TPGTestCase framework, which is just a layer around the basic code that is in uRenderDevice which takes care of getting everything setup for you so you can quickly test out your ideas. Using TPGTestCase you just override the proper methods. I included uDisplayDevice.pas and uRenderDevice.pas to show how to properly setup a basic render loop if you want to work at the lowest level.
    Jarrod Davis
    Technical Director @ Piradyne Games

  10. #40

    Re: PyroGineび「 Game Engine

    Thanks for the quick replies
    I have done as you said and downloaded the latest build. However, none of the Delphi samples show any text. The only thing uRenderDevice.pas file appears to do is display a blue screen, but no fps text.

Page 4 of 7 FirstFirst ... 23456 ... 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
  •