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

Thread: Trouble porting liquid simulation to Pascal - AARRGGHH!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by Ingemar View Post
    So it is almost-C code, intended for an interpreter? I would start by making it run as C code, and convert from there, but OTOH you have already made the conversion. I'll have a look at it.
    Thanks mate, much appreciated

    cheers,
    Paul

  2. #2
    Making a pure C version wasn't worthwhile. Evil twisted code full of vague implications, lots of undefined stuff. Maybe it isn't very strange that your port didn't work, I have some trouble understanding what the original code does.

  3. #3
    LOL! ok, perhaps it doesn't work and is different that what is actually being used then

    EDIT: hmm...I might try downloading the Java-Based Processing Programming Language mentioned, and try the supplied code to see if it is flawed or not

    ZOIKS! It is ~85MBs in size...oh well, downloading...

    cheers,
    Paul

  4. #4
    Ok, after a few minutes working out how to use Processing, I got the code as downloaded from the site to work just fine, so that is ok - it must be my port that is not working

    Here is the direct link to the processing code that I ported if you hadn't already gotten that

    http://1.shadowcdn.com/files/water_sim.zip

    cheers,
    Paul

  5. #5
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Looking through it - gives me a break from modularization of prometheus so you're welcome for posting this... Plus thats a nice article - maybe making a pascal version of the tutorial would be nice for the PGD archives
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  6. #6
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    paul: It wouldn't be a big nono if I wrote an equivalent bit of code to this since my port does not look too pretty in the IDE and gave you that instead? Trying to translate this C/C++ is not hard its just a tad annoying TBH. I wish we had a continue statement in pascal (not sure one does not exist actually ).

    I'll get back to you guys with my equivalent code for this most soon... A fluid simulation engine would be quite nice for my games too.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  7. #7
    I wish we had a continue statement in pascal (not sure one does not exist actually).
    It does in fact exist.

  8. #8
    Quote Originally Posted by paul_nicholls View Post
    EDIT: hmm...I might try downloading the Java-Based Processing Programming Language mentioned, and try the supplied code to see if it is flawed or not
    The whole idea of making an interpreted language running with an interpreter written in Java, clinging to every design flaw of C from 1970 (even re-intruducing some flaws that were fixed in the 80's), it stinks so bad from start to end that I don't want to let more of it than the example source near my computer. But fluid simulation is nice, so freshing it up it by porting it to FPC could be useful.

    One wish for the port: Portability! How about isolating all platform dependent stuff into one unit?

  9. #9
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Ingemar: I very much like that idea. Unfortunately I made an attempt to get this working but it is an utter failure in many senses... See below:

    I figured this might be easy so I wrote this up real quick: http://dl.dropbox.com/u/4853895/WaterSimF2.zip

    Its my WaterSimF2 unit I had a crack at and a TestApp using prometheus for drawing the TMX background and updating the water etc... It behaves a bit like water with one exception: IN REVERSE!!! Oo I have o idea why but it does XD

    So if anyone wants a fluid system that works in reverse until all the water is gone or just wants to mess around with it, see the link above

    Edit:
    Screenie:

    http://dl.dropbox.com/u/4853895/WaterSimF2_Screenie.png
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  10. #10
    Quote Originally Posted by code_glitch View Post
    Ingemar: I very much like that idea. Unfortunately I made an attempt to get this working but it is an utter failure in many senses... See below:

    I figured this might be easy so I wrote this up real quick: http://dl.dropbox.com/u/4853895/WaterSimF2.zip

    Its my WaterSimF2 unit I had a crack at and a TestApp using prometheus for drawing the TMX background and updating the water etc... It behaves a bit like water with one exception: IN REVERSE!!! Oo I have o idea why but it does XD

    So if anyone wants a fluid system that works in reverse until all the water is gone or just wants to mess around with it, see the link above

    Edit:
    Screenie:

    http://dl.dropbox.com/u/4853895/WaterSimF2_Screenie.png
    Hi code_glitch, I downloaded our port to have a look and found one thing - it doesn't compile using Delphi...

    For example, in the Prometheus_Core.pas file:


    Code:
    {$Mode Delphi}
    should probably be:

    Code:
    {$ifdef fpc}
    {$Mode Delphi}
    {$endif}
    cheers,
    Paul

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •