Urho3D from the scratch


#1

Hello and thank you for that engine, but…

I can not found any clear instructions how to install Urho3D from the scratch.

I’m new in gamedev and C++, so not exactly understanding how to organize file structure and build the new project.

YouTube videos are only for version 1.6 and less, so it it not compare with 1.7.

Please help! How my Urho3D folder structure should look like? And how to build Hello world app?


#2

It really depends. If you are planning on building games using prebuilt binaries, then all you have to do is set up the URHO3D_HOME environment variable and point it to the directory, where you have extracted the engine binaries.
If you plan on compiling project by yourself, get familiar with CMake which makes everything really easy.

For the ubuntu the stops for building the engine is as following:

sudo apt get-update
sudo apt-get install -y libgl1-mesa-dev git cmake g++ libx11-dev
git clone https://github.com/urho3d/Urho3D.git
cd Urho3D
bash cmake_generic.sh build
cd  build
make

If everything worked, build/bin and build/lib should contain everything you need and in this case you can point the URHO3D_HOME environment variable to point to Urho3D/build directory

Regarding the project structure it’s really up to you how you would like to structure the project. I would suggest looking at the Urho3DPlayer source code to get up and running.


#3

Thank you for reply.

It really depends.

This is the biggest problem for beginner. We don’t know how to do it best way.

For the ubuntu the stops for building the engine is as following:

I found the same build instructure for ubuntu or whatever, but I’m on windows. And that’s the second problem :slight_smile:

Is any tutorial of CMAKE build for Windows?


#4

On Windows it should be much simpler since command line won’t be used. Download CMake and Urho3D. Open up CMake, set the source directory to the one, where you’ve downladed engine source. Set the build directory (where the build files will be stored):

For example:
image
Note: Screenshots are taken on Ubuntu 16.04

Then at the bottom of CMake GUI press “Configure”, select your prefered compiler, wait for it to finish and then press “Generate”. On Windows I usually use Visual Studio so when I generate build files for VS the build directory should contain the Urho3D.sln file which can be used to open complete Visual Studio project for Urho3D. It will also contain sub-project Urho3DPlayer and all the samples.

Let me know if this helps.


#5

FWIW, building process on supported platforms
https://urho3d.github.io/documentation/HEAD/_building.html


#6

Regarding the code structure I always wanted to make a repo which would contain the skeleton app. So here it is:

It’s very much a WIP but at least is shows one of the ways how the project can be structurized.


#7

Oh, yes! Here it is!
Thank you so much, dear Miegamicis!


#8

If everything worked as expected, the output should be similar to this:


#9

I updated the repo with the tutorial and code samples.


#10

That’s really useful, thanks!


#11

I have added couple of things:

  1. *.as scripts which are placed in Data/Mods folder will be automatically loaded on startup.
  2. Config file loading on startup from the Data/Config/Game.json file. File contents are available withing the app by using GetGlobalVar method
  3. Splash screen animations
  4. Loading screen animations
  5. Basic scene from one of the Urho3D samples
  6. Code cleanup and readme file updated to reflect all the changes

Preview from one of the earlier builds which is missing few new things from the list


#12

Time for another update.

I added bunch of additional features that I think are necessary when starting new project:


#13

That’s really useful. I never thought about this stuff before and you made it look very easy. Thanks!


#14

I’ve been developing my hobby projects with this engine for the last 3 years so I have coded a lot of components and even more times rewritten them because of how bad they were. This is basically just putting together the “nice” stuff of all my projects and in parallel just thinking about new stuff that I think would be useful for my future projects.

Maybe you have any ideas how this can be improved further? I’m open to any suggestions.


#15

I think that a sample of graphics/sound settings screen would be crazy. Sliders and stuff. Controlling filtering, shadow quality, etc. Maybe even changing between DX and GL? That’s usually very hard to do right.

Other ideas:


#16
  • Input binding - already in my to-do list, hopefully can be done in the next week or so

  • Cvars - this actually is pretty simple to implement by this https://github.com/ArnisLielturks/Urho3D-Empty-Project/wiki/Console-commands
    I already did something similar in one of my projects

  • Level setup screen - I can take a look at this, maybe implement some sort of map dropdown before starting a level just to show how it could be done

Regarding switching between DX and GL I’m not really sure how it could be implemented, since graphics engine is chosen before building the engine itself.


#17

I think you could actually configure loading DX or GL if you used a shared library and added some logic to load one version or the other (maybe). It’s probably way more work than it’s worth, though. If it’s a real concern, my vote would be just have multiple executables.

How do you plan on doing a configurable input? And would it support joysticks and keyboard/mouse, or just one?


#18

Regarding the controller inputs I think that it will be as universal as possible, I will listen to mouse/keyboard/joystick inputs and map them against something so the users themselves can decide on what kind of controller they want to play the game. But let’s see how it goes.


#19

Shadow quality, AA, that’s also dependent on compilation options?


#20

Everything else can be changed on runtime.