Go Back   the Magicball Network > Forums > LBA Modifications > LBA Modifications - General
Buy LBA1/Relentless from GOG.com Buy LBA1/Relentless from DotEmu Buy LBA2/Twinsen's Odyssey from DotEmu Buy LBA2/Twinsen's Odyssey from GOG.com Buy Little big Adventure from GOG.com or DotEmu Buy Little big Adventure 2 from DotEmu or GOG.com

Welcome to the Magicball Network.

You are currently viewing our site as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Reply
 
Thread Tools
  #1  
Old 2017-01-02, 20:06
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Post 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 am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #2  
Old 2017-01-04, 01:00
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #3  
Old 2017-01-07, 11:41
Polaris's Avatar
Polaris Polaris is offline
Polly parrot
 
Join Date: Jan 2007
Location: Tippett Island
Posts: 5,868
Sounds like you're having fun
__________________
<((((((((((((([[[========================]]])))))))))))))>
Reply With Quote
  #4  
Old 2017-01-07, 19:16
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by Polaris View Post
Sounds like you're having fun
Yup! I still have lots to learn, but I can already write to a file in binary, so that's helping a lot! The way in which the surfaces work are at 0 by default, and if you increase that value, it literally raises that vertex. The matter is just making an efficient program - hopefully one that's user friendly. But, by the looks of it right now, it's going to be easiest for me to do it in just using a command prompt - which sucks without the user interface, but I'll see what I can do. I'm not giving up easily.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #5  
Old 2017-01-07, 19:24
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,811
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.
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #6  
Old 2017-01-12, 02:51
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by xesf View Post
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.
Thanks, Xesf.

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.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #7  
Old 2017-01-12, 04:41
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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.



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.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #8  
Old 2017-01-15, 00:22
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Lsba
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #9  
Old 2017-01-15, 04:47
MevX's Avatar
MevX MevX is offline
Amnesti
 
Join Date: Sep 2015
Location: Unity Island
Posts: 368
Quote:
Originally Posted by gravel22 View Post
Lsba
asödhjs
__________________
last place LBA ANY% 52:59
https://www.twitch.tv/amnesti

Citadel Island in Unity
https://forum.magicball.net/showthread.php?t=17983
Reply With Quote
  #10  
Old 2017-01-15, 19:50
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by gravel22 View Post
Lsba
Little 'Surface' Big Adventure? Or did you have something else in mind, Gravel?
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #11  
Old 2017-01-15, 19:51
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by MevX View Post
asödhjs
Is this an inside joke? Anyways, the program is coming close to working properly. I should have a download up in the future. I can't say exactly when it'll be up. But, I'll keep you guys posted.

I've managed to get colors working as well, so I'm going to make that possible in the program.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #12  
Old 2017-01-15, 21:30
MevX's Avatar
MevX MevX is offline
Amnesti
 
Join Date: Sep 2015
Location: Unity Island
Posts: 368
i thought he mashed random letters, so i did aswell
__________________
last place LBA ANY% 52:59
https://www.twitch.tv/amnesti

Citadel Island in Unity
https://forum.magicball.net/showthread.php?t=17983
Reply With Quote
  #13  
Old 2017-01-16, 18:54
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by MevX View Post
i thought he mashed random letters, so i did aswell
Hmm... Possibly. Anyways, I've managed to save terrain with my own heights!

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.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #14  
Old 2017-01-16, 19:05
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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.

__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #15  
Old 2017-01-16, 19:20
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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.



This is so awesome! The possibilities are growing!
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #16  
Old 2017-01-16, 21:41
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #17  
Old 2017-01-17, 11:27
Polaris's Avatar
Polaris Polaris is offline
Polly parrot
 
Join Date: Jan 2007
Location: Tippett Island
Posts: 5,868
Whoa, looks nice !
__________________
<((((((((((((([[[========================]]])))))))))))))>
Reply With Quote
  #18  
Old 2017-01-17, 13:52
Lupin's Avatar
Lupin Lupin is offline
Previously Link
 
Join Date: Dec 2001
Location: Paris
Posts: 2,762
Nice work so far MrQuetch!
Reply With Quote
  #19  
Old 2017-01-17, 17:45
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by Polaris View Post
Whoa, looks nice !
Thanks, Polaris. Finally getting some success.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #20  
Old 2017-01-17, 17:48
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by Lupin View Post
Nice work so far MrQuetch!
Thanks, Lupin. I'll be pushing limits to see what else I'm capable of. I'll try to get a program (or maybe part of the same one) for editing the terrain colors and textures, as well as floor types (like Twinsen drowning, burning, etc.).
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #21  
Old 2017-01-18, 07:03
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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 am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #22  
Old 2017-01-19, 03:59
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
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.



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.



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.
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-01-19 at 04:09.
Reply With Quote
  #23  
Old 2017-01-19, 10:23
Lupin's Avatar
Lupin Lupin is offline
Previously Link
 
Join Date: Dec 2001
Location: Paris
Posts: 2,762
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.
Reply With Quote
  #24  
Old 2017-01-19, 21:14
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by Lupin View Post
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.
Holy crap! Nice thread. Thanks, Lupin. Hopefully I can have something up and running soon. Last night I managed to create another section in my terrain program that enables the user to draw colors on the surface. When I get home from work, I'll try to post some images.

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?
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #25  
Old 2017-01-20, 00:59
Lupin's Avatar
Lupin Lupin is offline
Previously Link
 
Join Date: Dec 2001
Location: Paris
Posts: 2,762
It means it's an hexadecimal (base 16) number.
Reply With Quote
Reply

Tags
changer, color, creator, lba2, surface

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
deep neural network machine learning Neko Off topic 30 2016-06-09 12:01
Rosseta Stone learning program Dino-Fly Off topic 20 2007-09-29 23:04
I'm thinking about learning how to create Neko Off topic 12 2006-02-01 19:20
Learning better English by MBN'ing wacko Off topic 15 2001-06-02 22:18


All times are GMT +2. The time now is 19:08.


News Feed
Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2019, the Magicball Network