One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#1 2018-05-02 17:22:42

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

[TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

For everyone interested in playing with OneHourOneLife code - step by step tutorial how to:

  • Set up Ubuntu in VirtualBox on Windows

  • Enable shared directory between host and client OS in VBox

  • Install git and get required repositories

  • Get all required components and configure them

  • Prepare compilation process and clean up afterwards

  • Deploy Client in its own directory including all required files

1. VirtualBox

Compilation for Windows can be done both under Windows as well as under Linux. I find the steps required to compile on Linux way easier.
Step 1.1 If you don't have Linux machine ready - you can make use of VM VirtualBox. Instalation is quite painless and you can find download links here:
https://www.virtualbox.org/wiki/Downloads
Pick the lastest version for Windows host and follow the installer instructions.

Step 1.2 Second thing you will need is actual Linux distribution image. For ease of use I suggest you get lastest LTS Ubuntu from the following link:
http://releases.ubuntu.com/xenial/
Personally I'm using 16.04.4 LTS (Xenial Xerus) and if you want to be sure everythig will work EXACTLY like in this tutorial, get this distro

For people debating other distros superiority or just getting "the lastest, most up to date version". I've tried following this exact same steps with a little bit of wiggle room thanks to my previous experiences. On Unbuntu 18.04 I couldn't even get past setting up shared folder using guest additions. You for sure can do it somehow. I just can't be bothered testing every possible setup. This one works. If you don't want to spend hours debuging or you simply are new to the topic - get exactly this one.

Step 1.3 With VirtualBox installed and Ubuntu.iso ready we can proceed to create new machine.
In the VirtualBox user Machine->New (or Ctrl+N).
Call it whatever you like. Choose Linux Type and select your version. I will be using Ubuntu (64-bit) on my Windows 7 Ultimate (64 bit) host.
When prompted for RAM - try to allocate at last 1024 MB but I would suggest up to 2048 MB if you can spare.
After that you will be asked about hard drive - choose to create a new one.
Prefered setting would be VDI (VirtualBox Disk Image) as its native for VirtualBox. Choose other only if you know what you're doing and you need compatibility with other virtualization software.
Dynamically allocated size will help you to save up on initial resources.
As last step choose location and size of your new hard drive. Make sure to allocate at least 15 GB of HDD space. You will probably be fine with 10 GB but there have been cases where it was not enough. To be safe I'm using 20 GB myself. Location can be any.

Step 1.4 At this point you should see your new machine on the list. Before we run it we need to configure it more. Open settings (top panel, right click -> settings or Ctrl + S while machine is selected) and apply those "quality of life" fixes:

  • System->CPU - by default VBox limits machines to one CPU. If you have more cores available you might want to bump that up.

  • Screen - bump up your video memory. I tend to use max (128 MB?)

  • Storage - add new IDE controller and when prompted use "choose disc" option - find the downloaded Ubuntu image and mount it.

  • Network - switch from NAT to bridged mode. Click on the arrow to display advanced configuration. Switch Mode to "allow everyone" and randomize MAC address few times - just for a good measure. This will make sure your Linux will have its own local IP in LAN. You will be able to connect to your Linux server easier from other PC's, including your own Windows host.

  • Shared folder - add new one. Use any location for it but remember name you gave it. I will be using "Win7forUbuntu". Make sure you check "auto mounting" and, if possible, "permanent mode".

Step 1.5 This way you should have your machine ready to boot. Start it up!
You should be welcomed with Ubuntu instalation process. Choose instalation (not trial). Wait untill its done - it can take quite some time.
You might also be asked if you'd like to update as well - its up to you bit might prove to be usefull.

Step 1.6 After you're finaly done, you need to install yet another thing. From top menu choose "Devices -> Mount image with guest additions..."
This will mount CD image inside your machine and hopefully autostart. If not - you will have to run the application from mounted optical drive manualy.
Instalation process of "guest additions" may take quite some time and sometimes does not display any progress window - BE PATIENT. Afters its done it will comunicate that clearly and might ask for reboot. Don't do that yet (although you can, its just to speed up time on reboots).

Step 1.7 Open your Terminal (Ctrl + Alt + T)
If "guest additions" installed without a problem you should be able to find a new user group called "vboxsf". Use the following command to check that:

cat /etc/group

If you see one of the last entries containing vboxsf with id:999 - everything is fine. Otherwise - look around. Group might be named differently (but name should still somehow remind you of VirtualBox) OR your "guest additions" did not install properly (unmount image and mount it again) OR you really need to reboot your VBox.

Step 1.8 After you found your vbox group, you need to add yourself to the group to have access to shared folders.

sudo adduser {username} {group}

Where username is your user visible in command line before @ (or check it using command "users") and group is the VBox created group. In my case thats:

sudo adduser Joriom vboxsf

Step 1.9 To make changes apply follow that with:

exec su -l $USER
groups

After that you should see your usename followed by all the groups you are part of. One of them, probably last, should be "vboxsf". If its not there, reboot your VBox. If its still not there after reboot - try following the previous steps with installing actual additions again.

Step 1.10 When you're back up - check if you can access shared folder. Open up your terminal and change directories to /media/:

cd /media/
ls

You should see folder with name staring of "sf_" followed by share name you gave during machine configuration. In my case thats "sf_Win7forUbuntu". If you can't see that folder - proceed again with instalation of "guest additions" or ask google.
Now, you can browse to your shared folder and set up working directory:

cd sf_Win7forUbuntu
mkdir workdir
cd workdir

Open your shared directory under Windows. You should see "workdir" there. If thats the case - you have working shared directory and we can proceed with installing all the required components.

2. Prerequisites

Having VirtualBox set up and workdir ready, lets proceed with getting all the actual tools.
Step 2.1 First of all we need git to get code from github. In most linux distributions this should deal with the problem:

sudo apt-get update
sudo apt-get install git

Confirm when asked.

Step 2.2 Having a better text editor would be nice as well but is not mandatory. I would still recomend getting Sublime Text. In case of my Ubuntu 16.04 all I needed to do was:

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

Although I've had some problems with it on newer version. Important note: if add-apt-repository fails - it will brock any further use of apt-get. To fix that (only if it failed!) use the following code to revert to previous state (removing ppa from system):

sudo add-apt-repository -r ppa:webupd8team/sublime-text-3

Step 2.2a For Ubuntu 18.04 you might try this instead:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-add-repository "deb https://download.sublimetext.com/ apt/stable/"
sudo apt install sublime-text

its -qO with big "o", not 0 as a number.
If that does not work you can skip this part (and use nano or windows text exitor instead) or find instalation guide online for your distro. If you're not sure what distro you have:

cat /etc/*-release

Trying Ubuntu 18.04 myself now I've noticed you can also use the GUI and "Ubuntu Software" application to sreach for software "Sublime" and install it though graphical interface.

Step 2.3 Now, we can proceed to get more help! I've made set of scripts to help with actual configuration and deployment handling. Make sure your terminal is still in the previously created workdir and clone my repository:

git clone https://github.com/Joriom/OneLifeXcompile.git

It should create a new directory OneLifeXcompile with usefull scripts. Get in there.

cd OneLifeXcompile

Step 2.4 From here you can execute the following scripts to set up things for you:

./getBasics.sh
./getSDLforWin.sh
./getMingw-w64.sh

They're quite self explanatory.

Step 2.4a First one will get most of the stuff you need that is mentioned here:
http://onehouronelife.com/compileNotes.php?nocounter=1
If it does not recognize some components you will have to find equivalents made for your linux distro.

Step 2.4b Second one gets the correct version of SDL library (1.2 dev for Windows) and extracts it in workdir. It contrains icludes and libs we will use in next steps.
If you get error here - you will have to download and extract it manually.
https://www.libsdl.org/download-1.2.php
SDL-devel-1.2.15-mingw32.tar.gz (Mingw32)

Step 2.4c Third one might be tricky. If should work in most cases but your linux distro might require you to get mingw using different name.
If it fails, you will have to find your proper equivalent. Try using "sudo apt-get install mingw" and double tapping tab. If you don't have any hints appearing, try it with "gcc-mingw". If still no results - sudo apt-cache search "mingw" / "mingw32" / "mingw-w64" / etc... Try untill you find what you need or just google it. You can reuse this trick to find what distro you need mingw for:

cat /etc/*-release
3. Configuration

After that is done (hopefully it is) we can proceed with configuration.
Step 3.1 First - there is still a typo in Jasons minorGems code. It requests file "Winsock.h" instead of "winsock.h". To keep oryginal files pristine - we will create symlink.
Find where "winsock.h" is located in your system:

sudo find / -name "winsock.h"

Its most likely in /usr/{compilatorname}/include/
If there are multiple ones, focus on that looking the most like the one above.
Step 3.2 To switch to this location, create symlink and get back to workdir use the following (I'm using my path as example, make sure to use yours):

pushd /usr/i686-w64-mingw32/include/
sudo ln -s winsock.h Winsock.h
popd

ln as in small LN (not IN)

Step 3.3 After that - we need to prepare final compilation steps. First, find location of your compilator binary and its windres component:

sudo find / -name "*mingw32-g++"
sudo find / -name "*mingw32-windres"

Step 3.4 Now, having this knowledge lets open and fine tune compilation cofiguration. I'll be using sublime text (command subl). You can do this in any text editor or even under windows.
Proper configuration files were cloned along with my repository. They are under minorGems/game/platforms/SDL (inside OneLifeXcompile directory):

subl minorGems/game/platforms/SDL/Makefile.MinGWCross

Step 3.5 We need to edit four lines here:

Line 21: PLATFORM_COMPILE_FLAGS
A the end of line change: -I/media/........./SDL-1.2.15/include/
To your local directory where SDL was downloaded and unpacked. For me that was -I/media/sf_Win7forUbuntu/workdir/SDL-1.2.15/include/

Line 26: PLATFORM_LINKING_FLAGS
At the end of line change -L/media/........./SDL-1.2.15/lib/
To your local directory where SDL was downloaded and unpacked. For me that was -L/media/sf_Win7forUbuntu/workdir/SDL-1.2.15/lib/

Line 40: GXX: /usr/............../i686-w64-mingw32-g++
Enter full path to your compiler, in my case /usr/bin/i686-w64-mingw32-g++

Line 49: /usr/............./i686-w64-mingw32-windres
Enter full path to windres provided by mingw32, in my base usr/bin/i686-w64-mingw32-windres

Save changes. After that, you're ready to clone actual code and proceed with compilation.

4. Code & Compilation

Step 4.1 While still being in the directory you cloned first from my github (OneLifeXcompile), use the following scripts:

./removeAndCloneAgain.sh

This script removes Jasons repositories from workdir if you already had them and clones the lastest versions. You can reuse that if you ever feel lost while editing OHOL code and want to start clean.

Step 4.2 OneLifeXcompile

./applyLocalRequirements.sh

This script copies the file we just edited (Makefile.MinGWCross) along with some other usefull edited scripts and config files to their coresponding locations in Jasons repository. This also moves compilation scripts to their desired locations (OneLife/build).

Step 4.3 OneLifeXcompile

./compileAndMove.sh

This will finaly compile all the source files, link them, build an executable, collect all resources, pack them together and make new distribution in workdir named OneLife_v(Date) using current date and time to mark the build.

Step 4.4 If you're using this tutorial after already trying to compile or you compiled linux client already - you might consider using:

./cleanOldBuilds.sh

This will make sure that all *.o and *.dep files will be removed and compilation will start fresh. It cleans any possible problems with half of the program being compiled for linux and other half for windows (which will ofc fail).

Final Notes

Screens will be added at later date. Text was long enough to steal a lot of my time. If you can supply screens for particular steps while following the tutorial - I would be much obliged. Feel free to send them to me via mail jakub (dot) mroczkowski (at) gmail (dot) com or in private messages on Discord Joriom#0964.

If you have any doubts or if there are some mistakes - feel free to point them out. I'll fix it as much as I can.

Last edited by Joriom (2018-05-31 16:45:56)

Offline

#2 2018-05-02 17:23:42

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Reserved for possible expansion, screens or F.A.Q.

Step 4

presented in a video.
Shows the final commands and console outputs. Includes adding zoomed out FOVmod and how to merge code.
- clones code
- applies local requirements
- compiles and distributes vanilla client
- applies FOV mod
- resolves conflicts using meld merge tool
- changes zoom scale and recompiles
You will need to instal meld and configure it as default mergetool to get the same effects

sudo apt get meld
git config --gloval merge.tool meld

https://youtu.be/NVD5X7n-F4I

Last edited by Joriom (2018-07-16 04:09:16)

Offline

#3 2018-05-02 18:27:42

palisade
Member
Registered: 2018-04-19
Posts: 48

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Thanks for the hard work on making a cross compile tutorial. I also want to leave this here in case anyone wants to compile natively instead.

Install msys on Windows: http://www.mingw.org/wiki/Getting_Started

Grab and extract SDL:
http://www.libsdl.org/release/SDL-devel … w32.tar.gz

Grab and extract ImageMagick:
https://www.imagemagick.org/download/binaries/

I downloaded, ImageMagick-7.0.7-30-portable-Q16-x86.zip, but they're always removing older versions and releasing newer ones so be aware this version might not be available when you try to download, so just grab whatever is the latest x86 portable binaries.

Checkout minorGems, OneLife, OneLifeData7 from https://github.com/jasonrohrer
You can use TortoiseGit for this: https://tortoisegit.org/

From a cmd.exe prompt do the following from the extracted imagemagick directory:

copy magick.exe c:\MinGW\bin\convert.exe
copy magic.xml c:\MinGW\bin

From the extracted SDL directory in a prompt type:

copy bin\* c:\MinGW\bin
mkdir c:\MinGW\include\SDL
copy SDL\* c:\MinGW\include\SDL
copy lib\* c:\MinGW\lib

In gameSource/Makefile find COMPILE_FLAGS and append (with a preceding space): -I/usr/include -L/usr/lib

Run:
c:\mingw\msys\1.0\msys.bat

From the msys bash shell do the following in the folder that holds minorGems, OneLife, OneLifeData7:

find . -type f -name configure | xargs unix2dos

cd OneLife
./configure 3
cd gameSource
make

cd ../server
./configure 3
make

cd ../build
./makeDistributionWindows #

Change the # to the version number you want to build, e.g. 78.

It will produce a folder named something like this:
C:\src\OneLife\build\windows\OneLife_78

Make sure to never commit your email or account key ini files publicly from the settings folder.

Thanks to http://onehouronelife.com/forums/viewtopic.php?id=423 for some of the steps. I had to correct a few things.

I have confirmed I was able to play with these steps and it is much easier than setting up a vbox with ubuntu.

Last edited by palisade (2018-05-02 18:32:01)

Offline

#4 2018-05-02 19:43:54

spamvictim
Member
Registered: 2018-03-12
Posts: 12

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Both of u could go a step further and upload a ready to go compressed archive folder with all the needed configurations and automation scripts of repetetive tasks.
In the case of Joriom it would be the whole vm image and of course u could try to do it with a minimalistic linux environment, so the image isn't bigger than necessary, right.

Last edited by spamvictim (2018-05-02 19:47:15)

Offline

#5 2018-05-02 22:09:49

palisade
Member
Registered: 2018-04-19
Posts: 48

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Well in my case, I don't use a VM image. It is just a few tools and the checked out source code. There's no point in me providing you a ready to go bundled "system" because it would have to be reconfigured each time something changes (tools update, libraries change, even jason's OHOL changes). It is better that you set up your own development environment and learn to compile. Give a man a fish and he'll eat for a day. Teach a man to fish and he'll eat for a lifetime. As long as you follow the instructions, it will compile.

Offline

#6 2018-05-02 22:18:53

KucheKlizma
Member
Registered: 2018-04-14
Posts: 100

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

sudo passwd root
sudo su -

Screw ubuntu.

Also why Ubuntu and not CentOS?

Last edited by KucheKlizma (2018-05-02 22:20:42)

Offline

#7 2018-05-03 04:27:08

Uncle Gus
Moderator
Registered: 2018-02-28
Posts: 567

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Excellent tutorial, Joriom, thanks for that. If I ever get back to modding, I'll probably compile a custom client for it instead of using haxy .bat and .sh files to move folders around.

Offline

#8 2018-05-03 05:54:26

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

I didn't think it would turn out to be such a wall of text. In my head it seemd shorter. Now I'm considering making video tutorial out of it. Would solve problem with screens needed wherywhere.

Offline

#9 2018-05-03 14:19:45

Roolstar
Member
Registered: 2018-04-10
Posts: 102

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Thanks Joriom & palisade.

Awesome work guys, appreciate it


God is still learning to use His powers; and just like with any other mortal, it's gonna require both mistakes and time.

Only to eventually discover He did not create the world he always wanted, but the world he was forced to create.

Offline

#10 2018-05-03 21:34:03

spamvictim
Member
Registered: 2018-03-12
Posts: 12

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

palisade wrote:

Well in my case, I don't use a VM image. It is just a few tools and the checked out source code. There's no point in me providing you a ready to go bundled "system" because it would have to be reconfigured each time something changes (tools update, libraries change, even jason's OHOL changes). It is better that you set up your own development environment and learn to compile. Give a man a fish and he'll eat for a day. Teach a man to fish and he'll eat for a lifetime. As long as you follow the instructions, it will compile.

Is this how u reply to constructive feedback?
I show ur ungrateful ass a way to help even more ppl who want to get into client modding, but can't yet use these tools themselfs and u just shit on me by telling me what a noob I am cuz I can't compile?
Wait a sec... I think u just told a lie there... pathetic low life.

No matter how high I thought about u before cuz of ur tut... this response just shows me what a fucking retard u r.
Probably took you a whole week to compile that shit.

Get real, dude. The fact that u were able to compile something with instructions from someone else who already did it is no reason to be a arrogant pussy.
Cuz this dick here is on pussy hunt.

Since u don't know it, u can write scripts for almost every shit, even for getting the exact libs that r required to compile this sourcecode.
No, he probably won't change the version of the needed tools to compile in a long time. Yes, he could enhance the code by using additional dependencies.
But til then u already helped a bunch of ppl and if only one of them would be grateful enough to update ur rdy2go-releasepack.zip to the newest needed dependencies ur work is done. But instead u try to argue with me. And don't tell me shit about the fact that the sourcecode itself won't be the same soon after some new release tags. You already know about jasons scripts to clone the latest commit of his repos.

Am I saying u shouldn't mention how to do it from scratch? Hello nuh! But I am telling you that it is better to give the ppl the possibility to just modify the code without having to struggle with all this stuff. I'm not fucking telling you that u have to do it, just accept the fact that it would be better to reach out to even more ppl who would like to setup their own modded client/server pack, without losing them half way through the hardcore instructions. Cuz that's what it is for the 13yo timmy who wants to get into modding by playing with jasons code but being unable to easily compile it for his own os.

Last edited by spamvictim (2018-05-03 22:02:17)

Offline

#11 2018-05-03 21:39:45

palisade
Member
Registered: 2018-04-19
Posts: 48

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

spamvictim wrote:
palisade wrote:

Well in my case, I don't use a VM image. It is just a few tools and the checked out source code. There's no point in me providing you a ready to go bundled "system" because it would have to be reconfigured each time something changes (tools update, libraries change, even jason's OHOL changes). It is better that you set up your own development environment and learn to compile. Give a man a fish and he'll eat for a day. Teach a man to fish and he'll eat for a lifetime. As long as you follow the instructions, it will compile.

Is this how u reply to constructive feedback?
I show ur ungrateful as a way to help even more ppl who want to get into client modding, but can't yet use these tools themselfs and u just shit on me by telling what a noob I am cuz I can't compile?
Wait a sec... I think u just told a lie there... pathetic low life.

No matter how high I thought about u before cuz of ur tut... this response just shows me what a fucking retard u r.
Probably took you a whole week to compile that shit.

Get real, dude. The fact that u were able to compile something with instructions from someone else who already did it is no reason to be a arrogant pussy.
Cuz this dick here is on pussy hunt.

No, I'm not trying to be arrogant. If I bundle all that stuff together so you can one click compile without going through the steps it won't actually help you. The moment something changes in any one of those tools or code it will stop functioning. But, if you learn to download and install the tools, check out the code, and compile it following those steps it will work every time.

Not sure what you think I'm lying about. If you follow the instructions in the other thread I linked it won't compile and you will be left confused. I rewrote those instructions including a few vital pieces of information that was left out; I provided a link to the getting started page for msys that will help a lot, they had a broken link to imagemagick that I fixed, they left out the msys prompt command, they left out that you need to copy the magic.xml file and that you have to provide the version number when making the distribution. I also reworded it to make more sense and I wrote the commands that need to be used when copying. It is a clearer set of steps that I can confirm works.

I think everyone should be able to get in on client modding, it's fun. I posted the other steps that don't involve cross compiling from Linux because I know it is easier and doesn't involve having to set up an entire vm and learn a different operating system. I don't want you to not be able to participate.

And, yea, constructive feedback is welcome.

Last edited by palisade (2018-05-03 22:06:03)

Offline

#12 2018-05-03 22:13:43

palisade
Member
Registered: 2018-04-19
Posts: 48

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

spamvictim,

A script that grabs all the tools, code and libraries automatically would be pretty cool.

Though, download locations change. For example imagemagick deletes old downloads. That is why the other forum thread has broken links. They don't keep them around, so those would have to be mirrored. And, would people trust an unofficial mirror?

That is why I provided a link to the folder instead of a direct link to the file, and then just mentioned which version I was using.

Also, if Jason requires new features in a newer imagemagick it might break to keep using an old one. Or, if a newer version of the library causes ohol to stop working, that could likewise be a problem. I managed to get it working with the latest version in this case, but that isn't guaranteed to work with the next version of imagemagick that comes out.

I'm definitely not trying to come off as confrontational or disregarding your ideas.

Last edited by palisade (2018-05-03 22:27:47)

Offline

#13 2018-05-03 22:25:21

Uncle Gus
Moderator
Registered: 2018-02-28
Posts: 567

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

spamvictiom, increase your chill.

Offline

#14 2018-05-03 22:30:51

palisade
Member
Registered: 2018-04-19
Posts: 48

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Uncle Gus wrote:

spamvictiom, increase your chill.

I think using a proverb might have made my original reply seem dismissive and haughty. He probably thought I was trying to disrespect him with elitism or something.

This was the quote, and I kind of just slipped it into what I was saying. "Give a man a fish and he'll eat for a day. Teach a man to fish and he'll eat for a lifetime." -- Chinese philosopher Lao Tzu, founder of Taoism.

I think playing ohol lately has been making me think a lot about that quote. Because, when you raise your family in ohol and they're new, you really have to teach them how to do things or in the short lifetime they have they might not survive. And, you aren't around long enough to keep feeding and building for them yourself. So, I was in a thoughtful zen mood when I wrote it. Sorry.

It's no big deal. Just wanted to reply and let him know that's not how it was intended.

The reason I posted the simpler steps were because I knew joriom's while valid aren't for everyone. There are a lot of us who would prefer to compile on Windows and not have to go through the ordeal of setting up Linux to cross compile. No disrespect to joriom either, this cross compilation tutorial is awesome.

I'm on your side! I want this to be easier.

Last edited by palisade (2018-05-03 22:40:35)

Offline

#15 2018-05-04 05:23:00

spamvictim
Member
Registered: 2018-03-12
Posts: 12

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

1.) The fish example is nice and neat, but if u rlly think I got anything against game related philosophical rules u still didn't realized what made ur response sound like it sounds.

2.) I even let u know that I respected u for the rlly good tutorial, so how is it that u point it always out like I wouldn't appreciate it and even would have something against it?

3.) I'm pretty impressed u r trying to solve this calmly without even letting it escalate into a cock fight cuz I was already geared up, hah.

I accept ur apology for responding the way u did at the beginning. Even when I was trying to be rude u got the point that angered me.

Sry Jord, I knew I splashed over the edge of the pool at that point and would have accepted a final call on ur side or Chards.

Last edited by spamvictim (2018-05-04 05:24:51)

Offline

#16 2018-05-19 13:28:52

KazetaGaming
Member
Registered: 2018-05-06
Posts: 5

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Joriom, do you think it will be possible (with some work on my side) to make the crosscompilation work in a raspberry pi (raspbian OS) with no GUI which i am accesing by putty from windows?

EDIT: nvm, uncleGus have helped me a lot on the process.

Last edited by KazetaGaming (2018-05-20 12:53:09)

Offline

#17 2018-05-27 05:04:21

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

palisade wrote:

copy bin\* c:\MinGW\bin
mkdir c:\MinGW\include\SDL
copy SDL\* c:\MinGW\include\SDL
copy lib\* c:\MinGW\lib

This part has a mistake. 3rd line should be:
copy include\SDL\* c:\MinGW\include\SDL

palisade wrote:

In gameSource/Makefile find COMPILE_FLAGS and append (with a preceding space): -I/usr/include -L/usr/lib

I didn't need to do that. MinGW found all the libs on its own.
Also, don't get fooled... / is not the MinGW/ directory but rather MinGW/msys/1.0/
And the /usr/ just redirects to / as well

palisade wrote:

find . -type f -name configure | xargs unix2dos

Remember that if your compilation fails for whatever reason (like missing .h file or something) you don't need to repeat that step every time.

palisade wrote:

I have confirmed I was able to play with these steps and it is much easier than setting up a vbox with ubuntu.

Might be true. Works for sure. I've used this tutorial and after few more steps I was able to compile windows Editor as well.

Last edited by Joriom (2018-05-27 05:05:36)

Offline

#18 2018-05-27 06:09:05

YAHG
Member
Registered: 2018-04-06
Posts: 1,347

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

YOUR BEAUTIFUL MILKWEED CREST IS GONE!!!!!

It must not have regrown after you picked it..?


"be prepared and one person cant kill all city, if he can, then you deserve it"  -pein
https://kazetsukai.github.io/onetech/#
https://onehouronelife.com/forums/viewtopic.php?id=1438

Offline

#19 2018-05-31 13:57:06

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

Updated tutorial thanks to Roolstars input after following the instructions.

  • Fixed typo with missing ".sh" in one of scripts.

  • Added numbering for easier troubleshooting if someone gets stuck.

Offline

#20 2018-07-14 17:36:11

subria
Member
Registered: 2018-06-11
Posts: 85

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

I think i lose something in step 1.5 or 1.6
I can not find this: "Devices -> Mount image with guest additions..." anywhere. Can u help, Joriom?


Ownership is the solution for everything.

Offline

#21 2018-07-15 22:02:47

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

unknown.png

Offline

#22 2018-07-16 02:51:38

sleepydas
New User
Registered: 2018-07-16
Posts: 2

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

just wondering why all the linux stuff is necessary im obviously new to linux and c++. like whats to stop someone from using an ide on windows

was also wondering once its compiled how do you test it(if you made changes) do you have to have a custom server i assume the official servers would either patch it or not let you connect

Last edited by sleepydas (2018-07-16 03:00:24)

Offline

#23 2018-07-16 03:33:28

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

sleepydas wrote:

just wondering why all the linux stuff is necessary im obviously new to linux and c++. like whats to stop someone from using an ide on windows

was also wondering once its compiled how do you test it(if you made changes) do you have to have a custom server i assume the official servers would either patch it or not let you connect

Linux stuff is not nexessary. You can set up project in any IDE on Windows, for example Visual Studio. You would simply need to:
- collect and link all the required libraries
- manually set projects dependencies
- make sure all the include paths are just the way Jasons project files require (not only OneLife but also minorGems)
- define the same linker & compiler directives so correct parts of code compile
And perhaps make sure that compiler your IDE uses does not have conflicts in this code.
Aaaand then add post-compilation scripts to collect all the files, generate graphics (those are linux programms I think? so you would need to create project for them too....), etc.

Jason provided us with a lot of ready make scripts (they're mostly in minorGems) that make sure code is compiled correctly for Linux/Win/Mac. It would be a lot of additional work to remake them as a IDE project instead of makefile project. Trust me, I tried. Under the hood - this tutorial uses a lot of scripts made by Jason, even I am not sure which ones. I just modified those that didn't work for me.

As per testing - private server would be best. Server code is inluded in OneLife repository. Nothing really stops you though from testing on official servers. Hell - I did it myself - I've tested my bot on official server tongue As long as program reports correct client version, server does not check any further and lets you in.

Offline

#24 2018-07-16 04:10:16

Joriom
Moderator
From: Warsaw, Poland
Registered: 2018-03-11
Posts: 565
Website

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

I've made a small video while explaining how to apply zoomed out FOV mod - it contains the final steps of compilation, applying mod, merging, etc. Enjoy!
https://youtu.be/NVD5X7n-F4I

Offline

#25 2018-07-16 06:21:41

sleepydas
New User
Registered: 2018-07-16
Posts: 2

Re: [TUTORIAL] Cross-compilation of Windows client (+ VirtualBox setup)

ya it makes perfect sense now it is way easier your way thx for all the work you put in i got it to compile and ran it and its my first time with this virtual machine stuff(and alot of the process for that matter) so good work with the guide i can just imagine how much work it would be without the scripts.

Offline

Board footer

Powered by FluxBB