Jump to content

KeyWorld

Members
  • Posts

    379
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by KeyWorld

  1. Ok I see the problem.

    // Change this:

    $this->aAnimData[$anim][$nf] += unpack('lExtYOffset/lExtYOffset/lExtXOffset/lExtYOffset/lExtXOffset', fread($this->act, 0x14));

    $extrainfo = unpack('lbool', fread($this->act, 0x04));

    if($extrainfo['bool'] == 1) fseek($this->act, 0x10, SEEK_CUR);

    // To:

    fseek( $this->act, 4, SEEK_CUR ); // sound id, store it in a variable if you want

    $extrainfo = unpack('lbool', fread($this->act, 0x04)); // Extras infos (if you need)

    fseek($this->act, 0x10 * $extrainfo['bool'], SEEK_CUR);

    • Upvote 1
  2. May I ask how you know what length to put in fread() ?

    You just need to put enough length for the unpack().

    Example:

    unpack('fxScale/fyScale/lrotation/lsprType/lsprWidth/lsprHeight', fread($this->act, 24));
    For each name in the unpack(), take the first letter:

    f = float = 4 bytes

    l = long = 4 bytes

    4 (xScale) + 4 (yScale) + 4 (rotation) + 4 (sprType) + 4 (sprWidth) + 4 (sprHeight) = 24.

    Can you upload a act you have problem with ?

  3. Replace this part:

    for($patNo = 0; $patNo < $this->aAnimData[$anim][$nf]['numSubFrames']; $patNo++) {

    $this->aAnimData[$anim][$nf][$patNo] = unpack('lxOffset/lyOffset/lsprNo/lmirrored/Cred/Cgreen/Cblue/Calpha', fread($this->act, 0x14));

    if($this->aVersion >= 2.0 && $this->aVersion <= 2.3)

    $this->aAnimData[$anim][$nf][$patNo] += unpack('fxyScale', fread($this->act, 0x04));

    if($this->aVersion >= 2.4)

    $this->aAnimData[$anim][$nf][$patNo] += unpack('fxScale/fyScale', fread($this->act, 0x08));

    $this->aAnimData[$anim][$nf][$patNo] += unpack('lrotation/lsprType', fread($this->act, 0x08));

    if($this->aVersion >= 2.5)

    $this->aAnimData[$anim][$nf][$patNo] += unpack('lsprWidth/lsprHeight', fread($this->act, 0x08));

    }

    With:
    				for($patNo = 0; $patNo < $this->aAnimData[$anim][$nf]['numSubFrames']; $patNo++) {
    					$this->aAnimData[$anim][$nf][$patNo] = unpack('lxOffset/lyOffset/lsprNo/lmirrored/Cred/Cgreen/Cblue/Calpha', fread($this->act, 0x14));
    					     if($this->aVersion  < 2.0 ); 
    					else if($this->aVersion  < 2.4 ) $this->aAnimData[$anim][$nf][$patNo] += unpack('fxyScale/lrotation/lsprType', fread($this->act, 12));
    					else if($this->aVersion == 2.4 ) $this->aAnimData[$anim][$nf][$patNo] += unpack('fxScale/fyScale/lrotation/lspr_type', fread($this->act, 16));
    					else                             $this->aAnimData[$anim][$nf][$patNo] += unpack('fxScale/fyScale/lrotation/lsprType/lsprWidth/lsprHeight', fread($this->act, 24));
    				}
    There is also another problem after if you are reading a version < 2.3

    Well your function is very ugly, hard to debug. If there is still a problem, can you report your act version ?

    Edit: Sorry for the quote, the code bbcode was buggy...

  4. If possible avoid using sql querys in NPC scripts, because it will stop the server from running while the query is executed. This means you will have micro lags on your server when using a lot of sql querys or huge complicated querys which need long to execute.

    If you just use them in a small amount or less executed scripts you should be fine.

    There was an update some month ago to execute the query in another thread if i remember correctly, so you should not be able to freeze just by sending query.

    • Upvote 1
  5. What kind of a bug is it? Maybe it got fixed in recent webkit versions. Qt 5 also allows to embedd a webview based on webkit, which basically would give the same benefits as Awesomium or Berkelium.

    There are two borings bugs :
    • Can't display some BMP files, but after comparing with safari, it's seems it's maybe a chrome bug nor webkit (can't test on a recent version of safari).
    • And another one with the native scrollbar : it can triggered mousedown but not mouseup, click, etc. So if you do a draggable UI and you click on a scrollbar on this UI, it will start following your mouse but there is no way after to detect a mousedown to stop the the UI to follow you.
    But this bugs really depend of what you do with the rendering engine. Maybe you will not load BMP files for the UI, and maybe you will not manage the draggable UI using webkit :)
  6. The GRF Viewer tool helped me to find a lot of things to fix on the CORE.

    Bugs on some TGA version, some sprites with empty layer (wth ?), some bugs on the file manager, etc.

    I added the support to read sprites and palettes, fixed the next/previous buttons and add a thumbnail system.

    Textures:

    grf-viewer-textures.jpg

    Palettes:

    grf-viewer-palettes.jpg

    Sprites:

    grf-viewer-sprite01.jpg

    grf-viewer-sprite02.jpg

    Search feature (top right input):

    grf-viewer-search.jpg

    I re-worked the UI system of robrowser, it was a little buggy (from the old version).

    The RSM now support is natural shadding type (without, flat, or smooth) instead of using smooth shadding on all models, result: better render, faster loading.

    I fixed some bugs on Firefox.

    And I will now focus on working with sprite rendering on the next days.

    • Upvote 4
  7. I don't love the UI but I'm impressed by its speed (loading and searching, I didn't compare others features), it seems faster than others GRF Tool I tested (even a bit faster than my GRF Viewer, but yeah mine is writing in javascript).

    Good job, keep it up :)

  8. Goto sounds for me like a low level statement, so, as I thought, it's faster to emulate. I suppose that every While / For statement is disassembled to goto's sequence, so it was a surprise for me to read this in the manual:

    You got it. All for(), while(), switch(), if, else, internal func(), ... are converted to label + goto/callsub + jump_zero on runtime.

    But for keep the script readable it's better to not write the whole script using the low level statement (except if you have reasons like optimizations) :P

    doevent, donpcevent are used to run another script instance. It's often used to start action on other script. Example: a script to manage all games in your server:

    mes "Select the event to start";
    switch( select("Capture the Flag","Nyan Cat Catcher", "First Man Dying") ) {
     case 1:
    	  donpcevent "ctf::OnStartEvent";
    	  break;
    
     ...
    }

    It's good to know that donpcevent will run the script after yours end (it's not multi-thread), to run it after continue you have to pause the script

    donpcevent "todo::OnLol";
    sleep2 1; // execute todo::OnLol before continue.
    dowtfyouwant;

    And functions/callsub I think you know them, it's used to avoid redundant, have fun with arguments, and return to the main script when finished.

    Good luck for your project :)

    • Upvote 2
  9. just one question why is this in control panels section?

    Someone moved it here, I don't know why but yeah it should be better on "project > clientside".

    You are aiming to unpack RO2 vdk files? I got an unpacker for it, in case you want it I would be glad to send it to you.

    Nevermind, I think you said you allready did a loader for it.

    Amazing project btw, it is totally awesome!

    Yeah I already build a loader for it in html5/js, it was funny but I don't think I will use it further for other things :)

    -----------------------------------

    I add my RSM-Viewer in the project to work more and faster on the RSM file since it need some changes (optimize the compilation, add the animation, change the smooth normal methods, ...), what I love about this tool is the way it can be embedded to webpage :

    rsm-preview.jpg

    • Upvote 5
  10. Sorry, I didn't have much time to work on it since november because of all birthdays and celebrations (why everyone born around december ?).

    I'm not able to add the important speed up update on the loading. It was an idea to use multiple threads to parse the client files (using 4 threads is 4 times faster) but it seems we can't load multiple part of a file at the same time.

    But I don't care, I did some good optimization (on zlib, and file parsing) and the loading is still faster : 4.5 seconds to load Prontera (you can compare with the video, it's ~4 time faster).

    I still need to optimize one part of the loading, when a map have a lot of instances of the same models it's really slow : yggdrasil01 take 17 secs to load (wtf ?!).

    I did some improvements on the TGA Manager due to NPOT textures causing problems.

    ve_fild05.jpg

    I also add a DB file to add the blue sky (note: I don't plane to add the cloud features in the near future).

    gonryun.jpg

    I have to say also, this project will be (source) released this year, finished or not.

    I would like to donate you some money for the development of this awesome project. Where can I do it?

    There is no way to donate :)

    -----------------------------------------------------------------------

    Offtopic: I also played a little with RO2 VDK file archive.

    It's one of the easier format I find in my life, ~10 minutes to understand the structure, ~15 minutes to write a loader... Funny to see how this file is build...

    Note: no I don't plane to do a ro2browser...

    • Upvote 7
×
×
  • Create New...