![]() |
I've Been Learning C!
I just thought I'd let you guys know, especially since it's a new year! So, one of my new years resolutions goals is to make more programs in C!
There are a couple things I have in mind right now that I'm going to try and get working and hopefully have ready for everyone to download in the future! 1.) LBA2 Color Changer 2.) LBA2 Surface Creator Although they aren't necessarily exciting or fun, it will definitely be awesome to have more programs to modify / alter the game! I already know where the color information's are stored for all models from LBA2, and I already know how the surface information's are stored for the height maps. Now that I've got this much going, it's just a matter of learning more C, and getting the program to produce an output.lun file that can replace an entry in the already existing LBAPackageEditor! I know where the information's are stored because I've hexed the files to see where what is located. I'll keep you guys posted, and hopefully I'll have something soon! I said that I was going on a mission soon, but there is a nine month waiting list for the mission I plan to go to, so I should be here for another while... |
I've also discovered more of the file structure for the terrain's, including the background texture and sea informations. Unfortunately, the sea informations in the entire game are misleading - the person who typed "sea" should have typed "terrain type", because in the sea, are located the type of floors and colors / textures of the floor.
Knowing this knowledge, I could make a program that randomly generates colors / textures for the floor, and could do the same for whether Twinsen will drown, burn, or blow-up on a surface. Just letting you guys know, the possibilities are becoming bigger. Maybe someday it'd be possible to create an entire game out of the engine. ;) Right now I have terrain generations working slightly - you can input a number and the terrain will generate accordingly, using that value as a height for every single vertex in the grid. |
Sounds like you're having fun :)
|
Quote:
|
Good luck on learning.
C is a great programming language as a starting point. It can be both easy and complex to master it, but it will teach you loads of important subjects - special the lower level ones. LBA will be a great way to practice that, even if you're doing something that already exists. Just do it! The more you do, the more you learn. As an advice, start with simple stuffs and don't go over optimist for the initial programs. As you build your knowledge pick more and more challenging tasks. It will help you keep motivated and see small progresses in every step. |
Quote:
Yup, definitely a lot of learning - but it'll be worth it. The interface is already coming along quite nicely. I still have yet to save and load the algorithms, but saving in binary is working so far! That being said, (if I haven't said it already) you should be able to load already existing surfaces from the game as well. I plan on posting screen shots of the program at some point. ;) |
Figured I better post something for now.
A sample with the terrain, as you can see, it's clear that the terrain follows the height values. The algorithm is as follows: ------------------------------ 1.) Vertex 1 Height 2.) Vertex 1 (Extra) Height 3.) Vertex 2 Height 4.) Vertex 2 (Extra) Height 5.) Repeat for all vertices leading up to the end of the map from top-left to bottom-right. ------------------------------ So, in hexadecimal binary notation, values can go as far as 255. With the additional height for the vertices, the heights can go as high as 510! In that notation, 255 = FF. 0 is just simply 0. It's interesting the way in which hex is stored. http://i.imgur.com/GIMbF1v.png The mountains have been squashed, and everything is quite bumpy. The palm trees are even floating in the back. Some line segments are connected in different ways, so that's why there is some randomization in the pattern. As you can see to our left (Twinsen's right) that line segment is clearly perpendicular in relation to our point of view while most are facing our direction. |
Lsba
|
Quote:
|
Quote:
|
Quote:
I've managed to get colors working as well, so I'm going to make that possible in the program. |
i thought he mashed random letters, so i did aswell
|
Quote:
That one was a bit tricky, so now it shouldn't be too difficult to load them and color in the vertices appropriately. Xesf would be so proud right now! :) The program still needs some touching up, but I'll try and get an example posted. :cool: |
Alright, so here's how the program looks so far. The interface, such as icons are still cruddy, but things should be looking better soon. Believe me, this is more user friendly than it was before.
So, the vertices change the height that you have selected. The dark blue is at value 0, and the lighter blue is at value 32. So, although it's not a smooth transition in height, it really works in the game. http://i.imgur.com/Fkg7jxb.png |
Alright, guys. Here is the example from the program to the game! As you can see, the example shown here was put together rather quickly, but it just goes to show that it works! The different locations have been drawn in different colors corresponding to the height. Just start looking, and it will all make sense.
http://i.imgur.com/zhvXXux.png This is so awesome! The possibilities are growing! |) |
I'm also trying to see if I can make a static model editor at some point. I'm currently looking at simple lm2 formats (practically boxes), trying to decipher the algorithm. It's a bit tricky right now, but hopefully it will make more sense in the future.
Looks like the animated models are going to be a nightmare to figure out though. :( |
Whoa, looks nice !
|
Nice work so far MrQuetch!
|
Quote:
|
Quote:
|
I'm understanding how the models in the game (static ones anyways) are stored now. There's still much that I don't understand, but I've managed to add an extra quad on a model. It only works in the LBA Model Viewer right now, and for some reason when I try it in the game, it crashes... :-/
I'm just glad I've managed to add a vertex and some triangles. :) |
I for some reason cannot remember for my own life where the heck the army green colors of terrain are seen in LBA2! Anyways, they're there.
Here's a sample of color changing the terrain in LBA2. I currently do not have a program for coloring the terrain yet, but have managed to (using for loops) get all triangles in the grid to contain a single color. Here's some samples showing: Gray, Yellow, Army Green, and Emerald Blue. http://i.imgur.com/55FhGbJ.png We continue to march forward. ;) Unfortunately, I still have yet to learn about how the models in the game are stored. I quickly drew this up in Photoshop, and this is what I discovered using the LBA Model Viewer. The model seen here is one of the couple poles from the Desert Island Raceway that hold up the black & white checkered board. http://i.imgur.com/sNqbG0M.png Of course, much of it is possibly wrong. I may go back and change what I wrote down. It seems like the Viewer takes content less seriously, whereas in the actual game, it strictly takes everything seriously. So much as offsetting a single byte can make the game overload in memory and result in a crash. This one is going to take awhile, and it makes sense that nobody's made a model creator yet. But, I'm going to make the creator one of my goals. The image only had so much space, so after the materials, comes the polygons' colors, their numbers, and their data sizes. Apparently, there is some weird formula for getting the right data sizes, resulting in subtracting the data by 8 and then multiplying by the amount of polygons. |
You may want to check this thread: [Max/Blender models] and the follow-up thread here: LBA2 3D Chat.
You'll find a lot of information about the island file format there. It's not 100% complete, but it should give you a good overview. |
Quote:
As far as the LBA2 model structures are concerned, I'll try to look at that thread more when I have the chance. I generally have an hour or so for lunch break. May I ask what the '#h:'s mean? I know the S's are signed integers and the U's are unsigned integers. Does the 'h' just mean header? |
It means it's an hexadecimal (base 16) number.
|
All times are GMT +2. The time now is 10:29. |
Powered by vBulletin®
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2019, the Magicball Network