Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Pristontale in Unity

Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
I'm in to process of porting PristonTale into Unity. However, I DO NOT expect to complete this project as I am still a student and do not have unlimited time on my hands. I just thought it would be fun to see how easy or hard it would be.

So what am I doing exactly? I'm (primarily) using the resources from the leaked source code like audio, images and models to recreate PristonTale in Unity. Doing this greatly simplifies the internal workings of the game because Unity provides easy ways to implement animations, user interfaces, etc.

I will update this post with my progress. My current focus points are in red.

Camera controls
- Controls are implemented.
- Additional control variables exist but cannot be changed yet.

Movement controls
- Click to move as in PristonTale.
- Walking and running toggles implemented, way to toggle is not.
- Speed is currently not bound to items.

Items
- Item base has been created.
- All item types build on the base.
- Models for all armors in the leaked source have been imported.

Notes on items
Items exist as ScriptableObjects, meaning the do not exist as a physical thing in the world, but rather as data. Every item contains a name, weight, size and inventory image. Other items like armors or weapons build on this class through inheritance.Items can exist inside a script as a variable on a GameObject. For example, the GameObject can then detect when it has been clicked on and then add the item to the inventory and destroy itself (if the item was added successfully).

Inventory Data
- The inventory can easily be scaled up by changing some variables.
- Adding, moving and removing items is supported atm.
- Equiping items is being worked on.
- Optimizations could be done.

Notes on inventory data
I'm using two 3D arrays to store the items. The dimensions are [page, width, height]. One of the arrays contains the actual items, the other contains the index of the item at every slot taken up by the item. The image below is how one page of the inventory could look like.

uBPSRHz - Pristontale in Unity - RaGEZONE Forums


Interfaces
- Smooth transition is implemented.
- Keyboard shortcuts work.
- On screen buttons work.
- More interfaces have to be added among which a settings screen.

Inventory Interface
- Buttons are clickable. Not all buttons do something atm.
- Displayed items in the inventory update whenever the inventory changes.
- Displaying equipped items is being worked on.
- Interacting with the inventory with the mouse is being worked on.

Videos






 

Attachments

You must be registered for see attachments list
Last edited:

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
Nice work. But i think its much work to implement all the game Logic into unity too.

Each model has 3 shapes. Low,Medium and high resolution.
If you have more question about Models/Animation, you can ask me
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
It would be a lot of work indeed, but possible.
Do you know how PT splits the animations into 'Idle', 'Attack', 'Run', 'Walk', ... by any chance? I just eyeballed the frame at which the animation starts to loop...
 

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
Sure. In the smb files all the animation are in a row. The correct start end end frame for each animation set like idle, walk can be find in the inx file. there is an Identifier for each animation set, as example 64 = idle 80 = walk. Every entry there, contains the correct start and end frame.
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
Do you mean the offsets can b found in the .INX files by opening them with a hex editing tool?

I figured out that the .IN files in the leaked source code are actually .INI files containing just what I need... Sadly some of them are missing.
Also looks like some of them are missing some offsets. The Pillai Skillmaster ASE had 3 additional animations.

Any idea what a Pilgrim or Prayer class is supposed to be? They are listed in the files M1Bip.IN, M2Bip.IN, ... The files containing the offsets for anymations for player characters.
 

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
1. Frame Numbers can be found in inx Files. Check the Inx-Reader that i have released somewhere in this board.

2. Dont know what you mean by some offsets are missing. I my client data there are nothing missing. Maybe you have to download new files?

3. Pilgrim or Prayer are addional classes. So the are exists in the shared animation (M1, M2, ...) files too. Those files contains Animation sets for multiple character-models. You have to read the inx files for getting this informations.
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
Thanks a lot for your help.

What I mean by some offsets are missing is that the ASE files has more animations than the INI. I'll have a look at the INX file instead.

I didn't know about those classes at all. Do you know of any models for them?
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
Yesterday I had a bunch of problems getting animations to work properly. The were jumping and stretching all over the place. Managed to fix that by collapsing the motion trajectory scale. Having some trouble figuring out the headgear / crowns atm. :$: It doesn't help that I'm not familiar with most of them are supposed too look and I have to say... PT has a crappy naming convention.

This is what I have for the Atalanta Tier 1 up to Tier 4. The model seems to be right, but I'm not sure about the textures.

NcqTEuf - Pristontale in Unity - RaGEZONE Forums

9rBmtll - Pristontale in Unity - RaGEZONE Forums

C2XrrMD - Pristontale in Unity - RaGEZONE Forums

5ynIMey - Pristontale in Unity - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
I figured it's easier to convert the ASE files to FBX, then import them in Unity without texture files. It will then auto generate blanks materials and texture files with the right names. Takes a bit more time but this isn't going to be a fast project anyways.

Another question. Why are there no body #2 or body #5 (xxbx02.ASE)? How are the models mapped to items?
If I had to guess the models aren't changing between #2 and #3 and the textures are being mixed. So for example arms of #2 and legs of #3?

----------------- Edit ----------------

Also in the leaked source ASE files I found that some of the bone structures are incomplete or missing giving me a terminal error box on import. Copy / Pasting the bones from a working ASE files solves that.
 
Last edited:

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
1. Whats wrong with Texture assignment and coordinates? If you import Thema without Materials, you will lose all the informations to them.

2. I dont know the File that you talking about. Maybe I can Check it next days in my model viewer.

3. Items have to Connect tonthe right Animation Bone Like legt/right Hand so they will correct move by the Matrix

You other question are Not clearly to me :)
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
I don't understand the following...

These are the first 4 armors/bodies for the archer.
W4xKLGx - Pristontale in Unity - RaGEZONE Forums

Ej46kG8 - Pristontale in Unity - RaGEZONE Forums

FET85Ka - Pristontale in Unity - RaGEZONE Forums

iUkcsBz - Pristontale in Unity - RaGEZONE Forums


They use 3 textures and 3 ASE files.
ITRYG6w - Pristontale in Unity - RaGEZONE Forums
tfbd01.BMP
AXlRjZY - Pristontale in Unity - RaGEZONE Forums
tfbd03.BMP
2yjGW2N - Pristontale in Unity - RaGEZONE Forums
tfbd06.BMP

There isn't a model for each armor. The texture files and models are shared.
How do I know the correct model and texture combination for all armors?

-------------------------- Edit ---------------------------

Figured it out... Another case of me not digging deep enough (or being lazy / tired).
I already knew about the link SunnyZ gave me but hadn't looked at the A001.INI, A002.INI, ... files. :lol:

So if I understand correctly PT gets the model from the file depending on the race (TM), class (ABCD) and armor (001, 002, 003, ...)?

-------------------------- Edit ---------------------------

The error when opening an ASE file with missing bones. Have to force close 3Ds Max through task manager. I add the bones from another file to the ASE to solve it.

ZlL1lqo - Pristontale in Unity - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
RZA-PT | KilroyPT
Joined
Aug 27, 2007
Messages
936
Reaction score
85
wow nice work, keen to see how it goes with the rest of it,
i notice the speed is a bit out (i.e. when walking you see the ground moving under the foot) would love to see how it progresses.
 

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
You relly have to check the inx files :)

for archer you got a list of d001.inx - d031.inx (kpt) The first 64 by of each file leads you to the shape file.

char\tmABCD\tfbD01.ASE
char\tmABCD\tfbD03.ASE
char\tmABCD\tfbD06.ASE
char\tmABCD\tfbD21.ASE
char\tmABCD\tfbD22.ASE


this are the model files for Armor/Item

You can use my InxConverter for made them readable: View attachment InxConvert.rar
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
Just an update. I ported all Archer and Atalanta heads (up to Tier 4) and bodies (up to D022/mB022) over to Unity. Currently working on the interfaces.

Have some problems with rendering double sided transparent objects on top of each other. There must be a way to do this correctly since an over 15 year old game can do it. I'm probably overlooking something simple...

d8tTSPZ - Pristontale in Unity - RaGEZONE Forums

QlWrHvq - Pristontale in Unity - RaGEZONE Forums

8SZKuwd - Pristontale in Unity - RaGEZONE Forums

Twu3HYC - Pristontale in Unity - RaGEZONE Forums
------------------------------ Update -----------------------------

Found 3 not-very-elegant ways to fix the double sided transparent materials...

1) The first option is to do two shader passes, meaning there is an additional gpu drawcall per object. There still are some rare cases that it still is rendered wrong.
2) Second option is to simply not render a part of the texture with an alpha value of approximately 0. It's fine for desktops but can be hard on mobile devices (since it should work cross platform).
3) Third is to duplicate the normals.

Think I will go with the second option for now. Took me way too long to figure out how to do this...

Did some more user interface too.

------------------------------ Update -----------------------------

Refined the camera controls. Added manual, auto and locked mode.

------------------------------ Update -----------------------------

Managed to get the data part of the inventory to work with some dummy items.

I'm using two 3D arrays of size [2, 12, 6], however, the size can easily be increased or pages can be added. One of the arrays contains the actual items, the other contains the index of the item at every index taken up by the item. So for example:

Item 01 has a size of 1x1 and is stored at [1, 3].
Item 02 has a size of 2x2 and is stored at [2, 1].

uBPSRHz - Pristontale in Unity - RaGEZONE Forums


Just like in PT the item is added to the first possible spot when picked up. At first I was making a dumb mistake with the loops causing it to keep saying there was not enough room in the inventory... Gave me a headache for a while.

Still some improvements can be made but i'm too lazy. Since the default inventory is only 2x12x6 these optimizations wouldn't matter that much anyway.

(I could for example keep track of how many free slots are still free on page 1 and 2. If the item needs more slots that page can be skipped.)

------------------------------ Update -----------------------------

Only took me a little over 3 hours to get this working. Created a dummy item that contain an image, a width, height and name. The item can be attached to a script which makes an object clickable.

When the object is clicked the script tries to store the item in the inventory array. Only if this succeeds the clickable object is removed.

I can't move the items around in the inventory yet.



------------------------------ Update -----------------------------

Added functionality to move items around in the inventory. Will be doing some graphical aspects of the inventory soon. Currently I use a keyboard shortcut to move the first item to a set position.

------------------------------ Update -----------------------------

I will update what i'm working on in the first post of this thread.
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
It proves to be more difficult to draw the inventory correctly than I had hoped... Things got complicated when I started moving items around. The background color is really messing me up. :hmmmm:



----------------------------- Edit ----------------------------

Herpederp. There are a lot more colors than i thought there were.

Item that cannot be used.
Hovering pointer over item.
Hovering pointer over item that cannot be used.
Moving an item (without overlap).
Moving an item (with overlap over single item that can be used).
Moving an item (with overlap over single item that cannot be used).
Moving an item (with overlap over multiple items).

-------------------------- Edit ----------------------------

It will be easier to add an independent background layer to the inventory. I thought a background and foreground for each item would be enough but that's over-complicating things.

-------------------------- Edit ----------------------------

Done. I will start working on equipping items and displaying the appropriate model for the items next. After that I will add stats and add checks to make items wearable or non-wearable according to those stats.

I believe I will store the model for each item in the item itself. As a bonus, I could easily add something like Vormav's Customize Look that way.

 
Last edited:
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
The inventory is now fully working. It worked fine with 2 items in the video but once I tried to add more it derped... While debugging all these loops I cleaned the code up, so blessing in disguise I suppose.

Turns out that when I had 2 armors of the same type (for example 2x Battle Suit), I added the same copy twice because I was calling 'Inventory.Add(Item)' instead of 'Inventory.Add(Instantiate(Item))'. Because of that, checking if an item could be moved to a slot was bugged in some cases... Fixed it in this video.



---------------------------- Edit ----------------------------

Cleaning up the inventory code once again because I hate 'bad' code (especially when I wrote it myself).

Moved the selected item from the 'interface code' to the 'inventory code' and changing all actions like Remove/Move/Equip to use the selected item instead of the item passed to the function. When an item is selected, it is removed from the inventory arrays and stored separately.

I was first storing the selected item in the interface handling code and made sure not to draw that item. Yuck. Because the selected item isn't in the item arrays anymore I don't have to do that now.
 
Last edited:
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
72
Reaction score
26
Working on item system and equiping items but I haven't had a lot of time. I can equip items by pressing a button atm. Each item can have a model. Some code then checks the inventory if a certain item is equiped and draws the model stored in the item. If not it draws the default model.

 
Back
Top