XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sat Sep 22, 2018 11:48 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Argo Online map viewing
PostPosted: Fri Jun 15, 2018 12:32 pm 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times














You can make the ads go away by registering

Hey, despite the fact that five years have passed since the last post of post about Argo Online viewtopic.php?f=16&t=6393, I wanted to recognize the other files of this game. I took out my dusty disk with the Russian client of the game and installed it.
I found many useful scripts for bones, 3d models, textures and animations here, which still work. But now I have stopped on maps. It's not about "3D / 2D models", but I don't know where to write.

1) Folder .. \ Resources \ World \ mortalis ("mortalisWorld" in the archive below)
First I tried to get a map from the points that could be represented by float bytes from the *.xRaw file with the title "TERRAIN HEIGTH MAP", but the program gave it:
Image Image


The normal map *.tnm with the title "TERRAIN NORMAL MAP" looks like an image, but I do not know how the map data is stored and I can not extract it.
Image
The EXTRACTED folder contains the texture files * .dds and * .ptobj (I think this is the game engine data) from the internal folder archives that I got using a simple script
(UPD: The script didn't handle the names correctly. I modified the script from chrrox for the *.tbl2 file to *.tbl files):
Code:
#quickbms script
#ARGO

open FDDE tbl 1
get idName long 1
get archiveSize long 1
get someValue long 1 #???
get filesNumber long 1

goto 0x004018 1

for i = 0 < filesNumber
    get null long 1
    get offset long 1
    get zsize long 1
    get arcnum long 1
    get name string 1
    print "%arcnum%"
        set NAME1 string "file"
    set MYEXT string arcnum
    strlen MYEXTSZ MYEXT
    if MYEXTSZ == 1
        string NAME1 += "00"
    endif
    if MYEXTSZ == 2
        string NAME1 += "0"
    endif
    if MYEXTSZ == 3
        string NAME1 += ""
    endif
    string NAME1 += MYEXT
    string NAME1 += .data
    open FDSE NAME1 0

    Padding 4 1

   log name offset zsize


2) The folder .. \ resources \ world \ mortalis ("mortalis world" in the archive below), which I got using the chrrox script
 The celldata folder contains five file types: Empty *.cei, *.cma, *.cta, and similar to *.xRaw: *.coh, *.cth.
And also other files that make up the map.
3) The folder .. \ resources \ ui \ texture contains mortalismini.dds. Perhaps it will be necessary too.

My goal is to recreate the map of the game so that I can work with it.
I hope for any help (scripts, advices or tutorials) :)
Here is the link to the archive: http://www.mediafire.com/file/2ygv3jqs1 ... rtalis.zip


Last edited by Exse on Mon Jun 25, 2018 9:25 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Tue Jun 19, 2018 3:37 pm 
Offline
veteran

Joined: Wed Jan 11, 2012 10:21 pm
Posts: 133
Has thanked: 16 times
Have thanks: 0 time
Hi man , i'm interested in this game too but can't find a working link.
Do you have download link for this game?


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Tue Jun 19, 2018 9:50 pm 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
Drawing wrote:
Hi man , i'm interested in this game too but can't find a working link.
Do you have download link for this game?

I'm a girl :D
I already wrote that I have a CD with this game (this was an attachment to the game magazine in 2011). There are no working links for downloading on the network. But you can download it from me: http://www.mediafire.com/file/wosc494l2 ... Online.zip
P.S. It will be great if you understand something about it, because I'm a noob.
_______________________________________________________
About progress:
The first 18 bytes is the header, then there are 8 (4 + 4) bytes the number of vertices of width (513) and height (also 513). This gives 26 bytes of meta information in any * .xRaw file. The total number of bytes (1052702) minus meta information (26) gives the number of z vertices (1052676 = 513 * 513 * 4 byte float).
Image

Then I wrote a script to import xRaw into Obj for Blender (Thx to viewtopic.php?f=10&t=15453, because I didn't know Python before):
Code:
import struct

filePath = "C:\Onga\ArgoOnline\Resources\World\mortalis\mortalis.xRaw"
with open(filePath, "rb") as bin:
   
   bin.seek(0)
   header = struct.unpack("<BBBBBBBBBBBBBBBBBB", bin.read(18))[0]
   print(header)
   output = '# TERRAIN \n'
   width  = struct.unpack("<I", bin.read(4))[0]
   height = struct.unpack("<I", bin.read(4))[0]

   for x in range(height):
      for y in range(width):
         unk = struct.unpack("<f", bin.read(4))
         output = output + "v %f %f %f\n" % (float(y*1000), float(x*1000), unk[0]*1000)
         y += 1
      x += 1
   f = open(r"C:\Users\PC\Desktop\output.txt", "w")
   f.write(output)
   f.close()

And it works (the texture has a similar picture):
Image Image

Remarks:
1) For a correct display you need to invert z (or just flip).
2) Some maps have an empty header and the number of vertices. Then to get the width and height need subtract 26 from the total number of bytes, divide by 4 and take the root of the resulting number (all maps have the form of a square). This should work.

I still can not understand why the normal map also consists of floating values ​​as an object :?:
Wherever I looked, the normal map was a picture.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Wed Jun 20, 2018 4:11 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Tue Jul 05, 2016 9:37 am
Posts: 308
Has thanked: 16 times
Have thanks: 163 times
Exse wrote:
... gives the number of z vertices...Then I wrote a script to import xRaw into Obj for Blender

Not quite sure why you're doing it this way. But regarding that there's such a topic: Understanding Maps/Terrain, I guess you're trying to do the same process there as reverse engineering the geometry/model from a height map?
Exse wrote:
I still can not understand why the normal map also consists of floating values ​​as an object :?:

Not surprisingly, as colors can also be represented by floats as percentages.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"No investigation means no right to speak."
An Imitable Workflow for Reverse Engineering a Game Model

Don't forget to thank people by clicking the Image when you get helped.


Last edited by Bigchillghost on Wed Jun 20, 2018 11:35 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Wed Jun 20, 2018 6:52 am 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
Bigchillghost wrote:
Not quite sure why you're doing it this way. But regarding that there's such a topic: Understanding Maps/Terrain, I guess you're trying to do the same process there as reverse engineering the geometry/model from a height map?
Yes, I also gave this link in this message.
I want to be able to use all of the resources that are in the game, and I started with maps.

Bigchillghost wrote:
Not surprisingly, as colors can also represented by floats as percentages.
Ok, I didn't understand how the colors are stored before, thanks.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Wed Jun 20, 2018 7:36 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Tue Jul 05, 2016 9:37 am
Posts: 308
Has thanked: 16 times
Have thanks: 163 times
Exse wrote:
Yes, I also gave this link in this message.

Yeah it's from your message actually.
Exse wrote:
I want to be able to use all of the resources that are in the game, and I started with maps.

You know the word "map" sometimes can really be confusing, coz you don't know whether it's referring to a 3D or a 2D concept. But according to that topic you discovered, it's pretty much clear now.
However there's still one thing I don't understand. Why are there some vertices missing in your pics? If you view it from the z axis, it should looks like a plane full of points, shouldn't it?

_________________
"No investigation means no right to speak."
An Imitable Workflow for Reverse Engineering a Game Model

Don't forget to thank people by clicking the Image when you get helped.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Wed Jun 20, 2018 8:18 am 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
Bigchillghost wrote:
However there's still one thing I don't understand. Why are there some vertices missing in your pics? If you view it from the z axis, it should looks like a plane full of points, shouldn't it?
I just made a screenshot in the perspective projection, so the points are distorted. Look at the y axis (the green arrow), it is tilted.
Exse wrote:
Image


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Wed Jun 20, 2018 8:43 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Tue Jul 05, 2016 9:37 am
Posts: 308
Has thanked: 16 times
Have thanks: 163 times
No, I mean the empty rectangular area inside the map square. There're still some vertices connecting the two point planes that're visible even you're from a perspective view.

_________________
"No investigation means no right to speak."
An Imitable Workflow for Reverse Engineering a Game Model

Don't forget to thank people by clicking the Image when you get helped.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Wed Jun 20, 2018 10:09 am 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
Bigchillghost wrote:
No, I mean the empty rectangular area inside the map square. There're still some vertices connecting the two point planes that're visible even you're from a perspective view.
There begins a great height for the mountains (a jump from 0 to 50 000 per 1 square), which is probably the reason that the distortion is so great (I multiplied heights by 1000). The vertices connecting the central rectangle to the right and left have only about 5000.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Thu Jun 21, 2018 9:37 pm 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
I have some questions:
1) The height map has 513 vertices in width and 513 in height, the normal map is also 513 * 513. But the number of pixels should be less than the number of vertices in width and in height by 1 (512 * 512), is not it?
2) I tried to add faces to my script, but I get this error every time.
Code:
importing obj "C: \ Users \ PC \ Desktop \ mmm.obj"
        parsing obj file "C: \ Users \ PC \ Desktop \ mmm.obj" ... 10.3129 sec
        loading materials and images ...
        building geometry ...
        verts: 263169 faces: 261633 materials: 1 smoothgroups: 0 ...
Traceback (most recent last call last):
  File "C: \ Program Files (x86) \ Blender Foundation \ Blender \ .blender \ scripts \ import_obj.py", line 1191, in load_obj_ui
    POLYGROUPS.val
  File "C: \ Program Files (x86) \ Blender Foundation \ Blender \ .blender \ scripts \ import_obj.py", line 956, in load_obj
    create_mesh (scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc_split, verts_tex, faces_split, unique_materials_split, unique_material_images, unique_smooth_groups, vertex_groups, dataname)
  File "C: \ Program Files (x86) \ Blender Foundation \ Blender \ .blender \ scripts \ import_obj.py", line 453, in create_mesh
    face_mapping = me.faces.extend ([f [0] for f in faces], indexList = True)
KeyError: 'index out of range'

And 3DS Max says that my faces are duplicated.
Code:
import struct
import os
from math import sqrt

heightPath = "C:\Onga\ArgoOnline\Resources\World\mortalis\mortalis.xRaw"
normalPath = "C:\Onga\ArgoOnline\Resources\World\mortalis\mortalis.tnm"
statInfo = os.stat(heightPath)
size = int(sqrt((statInfo.st_size - 26) / 4))
print(size)
with open(heightPath, "rb") as h:
   output = '# TERRAIN \n'
   h.seek(26)

   for x in range(size):
      for y in range(size):
         unk = struct.unpack("<f", h.read(4))
         output += "v %f %f %f\n" % (float(y), float(x), unk[0]*(-1))
         y += 1
      x += 1         
   with open(normalPath, "rb") as n:
      output += "\n# NORMAL \n"
      n.seek(26)

      for x in range(size):
         for y in range(size):   
            red = struct.unpack("<f", n.read(4))
            blue = struct.unpack("<f", n.read(4))
            green = struct.unpack("<f", n.read(4))
            output += "vn %f %f %f\n" % (red[0], green[0], blue[0])
      output += "\n# VERTEX \n"
      global no
      no = 1
      global xn
      xn = 0
      global lineSize
      lineSize = 0
      while no < ((size-1)*(size-1)):
         if lineSize == size:
            lineSize = 0
            no += 1
            xn += 1
         output += "f %d//%d %d//%d %d//%d %d//%d\n" % (no+xn-1, no, no+xn, no, no+xn+size-1, no, no+xn+size, no)
         no += 1
         lineSize += 1
      
      f = open(r"C:\Users\PC\Desktop\mmm.obj", "w")
      f.write(output)
      f.close()
      print("Done!\n")

Here's what I get at the output: http://www.mediafire.com/file/n2vniydup ... rtalis.obj


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Fri Jun 22, 2018 2:49 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Tue Jul 05, 2016 9:37 am
Posts: 308
Has thanked: 16 times
Have thanks: 163 times
Exse wrote:
I tried to add faces to my script, but I get this error every time.
And 3DS Max says that my faces are duplicated.

For obj format the indices range from 1.
Code:
output += "vn %f %f %f\n" % (red[0], green[0], blue[0])

Actually the RGB should be limitted to the 2D concept. Here for vertex normals, it's Normal x, y and z.
Code:
output += "f %d//%d %d//%d %d//%d %d//%d\n" % (no+xn-1, no, no+xn, no, no+xn+size-1, no, no+xn+size, no)

I'm glad that you' choose to use a natural and more pleasing way to do it. But this line of code is not correct. The way creating a quad is slightly different from creating a triangle. Try this modified one:
Code:
import struct
import os
from math import sqrt

heightPath = "..\mortalis.xRaw"
normalPath = "..\mortalis.tnm"
statInfo = os.stat(heightPath)
size = int(sqrt((statInfo.st_size - 26) / 4))
print(size)
with open(heightPath, "rb") as h:
   output = '# TERRAIN \n'
   h.seek(26)

   for y in range(size):
      for x in range(size):
         unk = struct.unpack("<f", h.read(4))
         output += "v %f %f %f\n" % (float(x), float(y), unk[0])
         x += 1
      y += 1         
with open(normalPath, "rb") as n:
   output += "\n# NORMAL \n"
   n.seek(26)

   for y in range(size):
      for x in range(size):   
         Nx = struct.unpack("<f", n.read(4))
         Ny = struct.unpack("<f", n.read(4))
         Nz = struct.unpack("<f", n.read(4))
         output += "vn %f %f %f\n" % (Nx[0], Ny[0], Nz[0])
         x += 1
      y += 1   
output += "\n# Faces  \n"
lineSize = size - 2
for y in range(lineSize):
   for x in range(lineSize):   
      output += "f %d//%d %d//%d %d//%d %d//%d\n" % (x+y*size+1, x+y*size+1, x+y*size+2, x+y*size+2, x+(y+1)*size+2, x+(y+1)*size+2, x+(y+1)*size+1, x+(y+1)*size+1)
      x += 1
   y += 1
f = open(r"..\mmm.obj", "w")
f.write(output)
f.close()
print("Done!\n")

It's still a bit slow though.
This is the result:


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"No investigation means no right to speak."
An Imitable Workflow for Reverse Engineering a Game Model

Don't forget to thank people by clicking the Image when you get helped.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Mon Jun 25, 2018 2:43 am 
Offline
veteran

Joined: Wed Jan 11, 2012 10:21 pm
Posts: 133
Has thanked: 16 times
Have thanks: 0 time
Hi :), thanks for the link

I tried to unpack it with the script you provided and the one on xentax , I run script and select only file.tbl2 but when i try to extract it I got this message:


Code:
enter in folder C:\Onga\ArgoOnline\Resources
- open input file C:\Onga\ArgoOnline\Resources\file.tbl2
0
- enter in folder C:\Onga\ArgoOnline\Resources
  coverage file 0     0%   0          11780916   . offset 0000000000000000
- open input file C:\Onga\ArgoOnline\Resources\file0000.data2

- error in src\file.c line 465: fdnum_open()
Error: No such file or directory

Last script line before the error or that produced the error:
  34  open FDSE NAME1 0

Press ENTER or close the window to quit


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Mon Jun 25, 2018 9:15 am 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
Drawing wrote:
I tried to unpack it with the script you provided and the one on xentax , I run script and select only file.tbl2 but when i try to extract it I got this message

Hi again)
The error says that the script tries to open file file0000.data2. But the script should try to open only the files fileXXX.tbl2, not fileXXXX.tbl2.
Have you changed anything in the script from chrrox?
chrrox wrote:
Code:
#quickbms script
#ARGO
#from chrrox

open FDDE tbl2 1
set arcnum 0


goto 0x10001C 1

for i = 0
    get offset long 1
    get zsize long 1
    get null3 long 1
    get size long 1
    get arcnum long 1
    print "%arcnum%"
        set NAME1 string "file0"
    set MYEXT string arcnum
    strlen MYEXTSZ MYEXT
    if MYEXTSZ == 1
        string NAME1 += "00"
    endif
    if MYEXTSZ == 2
        string name1 - 1
        string NAME1 += "0"
    endif
    if MYEXTSZ == 3
        string name1 - 1
        string NAME1 += ""
    endif
    string NAME1 += MYEXT
    string NAME1 += .data2
    open FDSE NAME1 0


    get null1 long 1
    get null2 long 1

    get name string 1
    Padding 4 1

    get null long 1
if zsize == size
        log name offset zsize
else
clog name offset zsize size
endif
next i

P.S. I gave a script for *.tbl files, not for *.tbl2.


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Mon Jun 25, 2018 1:04 pm 
Offline
veteran

Joined: Wed Jan 11, 2012 10:21 pm
Posts: 133
Has thanked: 16 times
Have thanks: 0 time
Ah sorry I didn't see your script was for .tbl, anyway I tried script from chrrox but I got the same error I posted before.

In resource folder I got : file.tbl2 and a lot of filexxx: from file000.data2 to file148.data2
I realy don't understand what I miss...


Ok I understand the problem. In the folder there are filexxx and not filexxxx. I tried to rename some of them in filexxxx and the script works fine.
It's a pain the ass to rename every 148 file , so is there a quick way to modify the script? I really don't know how D:


Top
 Profile  
 
 Post subject: Re: Argo Online map viewing
PostPosted: Mon Jun 25, 2018 1:55 pm 
Offline
n00b

Joined: Sun Jul 23, 2017 7:03 pm
Posts: 14
Has thanked: 3 times
Have thanks: 3 times
Drawing wrote:
Ok I understand the problem. In the folder there are filexxx and not filexxxx. I tried to rename some of them in filexxxx and the script works fine.
It's a pain the ass to rename every 148 file , so is there a quick way to modify the script? I really don't know how D:

Oh, I forgot that I changed it. Here is the final script code:
Code:
#quickbms script
#ARGO

open FDDE tbl2 1
set arcnum 0


goto 0x10001C 1

for i = 0
    get offset long 1
    get zsize long 1
    get null3 long 1
    get size long 1
    get arcnum long 1
    print "%arcnum%"
        set NAME1 string "file"
    set MYEXT string arcnum
    strlen MYEXTSZ MYEXT
    if MYEXTSZ == 1
        string NAME1 += "00"
    endif
    if MYEXTSZ == 2
        string NAME1 += "0"
    endif
    if MYEXTSZ == 3
        string NAME1 += ""
    endif
    string NAME1 += MYEXT
    string NAME1 += .data2
    open FDSE NAME1 0


    get null1 long 1
    get null2 long 1

    get name string 1
    Padding 4 1

    get null long 1
if zsize == size
        log name offset zsize
else
clog name offset zsize size
endif
next i 


Last edited by Exse on Mon Jun 25, 2018 6:22 pm, edited 2 times in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: solidpoke412 and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group