Setting up and compiling the source code

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Setting up and compiling the source code

Postby CloudVII » 2011-03-24, 20:16

First of all, I just registered and learned about the Cafu engine early yesterday. I'm the(to be) lead game developer and owner of my team Nerfodestiny(currently counting me and a friend, however he currently doesn't have the computer to design games), I've been developing games in both game maker, RPG maker, and UDK. Morely creating mods and testing things.

I just found Cafu earlier yesterday, and it really suits my upcoming game. But I can't seem to setup the code(See: Link), It's probably me, but I feel like it's not detailed enough, and I've done everything it said(up to Python and SCons), but instead of getting

Code: Select all

> scons -v
SCons by Steven Knight et al.:
        engine: v2.0.0.final.0.r5023, 2010/06/14 22:05:46, by scons on scons-dev
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation


I get

Code: Select all

>>> scons -v
Traceback <most recent call last>:
  File "<stdin>", line 1, in <module>
NameError: name 'scons' is not defined


So can someone hold my hand and walk me through how to set this up and build it?

Thanks.
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-24, 20:56

Hi CloudVII,
welcome to the Cafu forum! :welcome:

CloudVII wrote:It's probably me, but I feel like it's not detailed enough,

If there is anything specific that you would like us to add, please let us know! I'd be happy to add any improvements possible.


I get

Code: Select all

>>> scons -v
Traceback <most recent call last>:
  File "<stdin>", line 1, in <module>
NameError: name 'scons' is not defined

Which operating system do you use?
Did you install SCons as an administrator? If not, please try to re-install using right-click, then select "Run as administrator".
(And if you're using VS 2010 / 10.0, please get SCons version 2.1.0.alpha instead.)

Oh! Stop! :cheesy:
Are you trying to run SCons from the Python command line? (The three leading >>> in your example, and the details of the error message seem to suggest that.) If that is so, please disregard my above talk about re-installing, but just re-run SCons from the system command prompt. :up:
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-24, 21:47

Yeah, I didn't think it explained how to do certain things enough(or atleast came to an abrupt end about stuff).

Ohh, That makes sense, I kept thinking I was supposed to use the python command line.

Yeah now it works. Sorry about that XD

Also, Two more questions, more about the compiling, what does it mean about
"Copy file Cafu/CompilerSetup.py.tmpl to Cafu/CompilerSetup.py. Note that the file must really be copied, renaming it or using the .tmpl source file is not enough. :!:"?
Do I copy and paster CompilerSetup.py.tmpl in the same exact folder and get rid of tmpl? or do I paste it in some other folder?

also, In your project ideas area, I saw that you we're thinking of using Direct X 11 in the future? When do you plan on doing that if you do? I was eventually for my game going to phase out opengl and the current directX and completely use DX11.

EDIT: Nevermind about my second question.
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-25, 11:29

CloudVII wrote:Yeah, I didn't think it explained how to do certain things enough(or atleast came to an abrupt end about stuff).

Ok, as mentioned before, if you can name specific sections of text, I'll be happy to fix them.

Ohh, That makes sense, I kept thinking I was supposed to use the python command line.
Yeah now it works. Sorry about that XD

Ok, thanks for letting me know!

Also, Two more questions, more about the compiling, what does it mean about
"Copy file Cafu/CompilerSetup.py.tmpl to Cafu/CompilerSetup.py. Note that the file must really be copied, renaming it or using the .tmpl source file is not enough. :!:"?
Do I copy and paster CompilerSetup.py.tmpl in the same exact folder and get rid of tmpl? or do I paste it in some other folder?

I've just updated and clarified section Compiler Setup. Is that better?

also, In your project ideas area, I saw that you we're thinking of using Direct X 11 in the future? When do you plan on doing that if you do? I was eventually for my game going to phase out opengl and the current directX and completely use DX11.

EDIT: Nevermind about my second question.

Well, ok. ;)
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-25, 16:34

Carsten wrote:Ok, as mentioned before, if you can name specific sections of text, I'll be happy to fix them.
Okay, Well, could you fix up the area about setting up and installing Python and SCons? Just in general, I had a hard time following it, maybe you could detail it a bit more?
to be more specific, this bit of text:

That is normally all, but you may wish to check if the Python installer added Pythons Scripts directory to the PATH environment variable of your system. For example, if Python was installed in C:\Python27, then PATH should contain both C:\Python27 and C:\Python27\Scripts. Otherwise, you have to add the proper directories manually: See http://support.microsoft.com/kb/310519 and http://vlaurie.com/computers2/Articles/environment.htm for additional information.
I didn't really understand what you meant I was supposed to do with the PATH environment.(I'm very slow and dim minded sometimes.. :oops: )
I checked the links, but they didn't explain very well, either.

Carsten wrote:I've just updated and clarified section Compiler Setup. Is that better?
Yeah, that's much better.

Another question. I named my Cafu folder 'Cafu', and I placed it in my local disk/C: folder. When I ran scons in the command prompt, I got this error:

Code: Select all

> scons

scons: *** No SConstruct file found.
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.1.0.alpha.20101125\SCons\Script\Main.py", line 900, in _main



Also, I'd like to say, this is probably the most helpful community I've been on. between getting called a noob, newb, or that I suck on some sites, to getting little to no help on UDK. This is a very nice site XD
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-25, 23:38

CloudVII wrote:Okay, Well, could you fix up the area about setting up and installing Python and SCons? Just in general, I had a hard time following it, maybe you could detail it a bit more?

Ok, thanks, I'll look into it.
In fact I'm aware that SCons is not the easiest tool to use for many users. As soon as I can find a build system (like CMake, Premake4, etc.) that can build all of Cafu and create Visual Studio Solution files on Windows and (e.g.) Makefiles on Linux, I'll probably use and support that in the future, too...

Another question. I named my Cafu folder 'Cafu', and I placed it in my local disk/C: folder. When I ran scons in the command prompt, I got this error:

Code: Select all

> scons

scons: *** No SConstruct file found.
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.1.0.alpha.20101125\SCons\Script\Main.py", line 900, in _main

Ah, did you cd into that folder before you ran SCons? E.g.

Code: Select all

d:\Dev\Some\Files> c:

C:\> cd Cafu

C:\Cafu> scons



Also, I'd like to say, this is probably the most helpful community I've been on. between getting called a noob, newb, or that I suck on some sites, to getting little to no help on UDK. This is a very nice site XD

:thanks:
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-26, 03:07

Carsten wrote:Ok, thanks, I'll look into it.
In fact I'm aware that SCons is not the easiest tool to use for many users. As soon as I can find a build system (like CMake, Premake4, etc.) that can build all of Cafu and create Visual Studio Solution files on Windows and (e.g.) Makefiles on Linux, I'll probably use and support that in the future, too...

I've actually never heard of SCons, or any compiler type programs. I've used C++ and XNA before, but not for long extents.

Carsten wrote:"Ah, did you cd into that folder before you ran SCons? E.g.

Code: Select all

d:\Dev\Some\Files> c:

C:\> cd Cafu

C:\Cafu> scons

Nope, I didn't do that. It started to compile(?).

Except after a minute or two, I got this:

Code: Select all

C:\Cafu> scons
scons: Reading SConscript files ...

os.chdir<'ExtLibs/wxWidgets/build/msw'>
nmake /nologo /f makefile.vc BUILD=debug SHARED=0 RUNTIME_LIBS=static COMPILER_PREFIX=vc10 TARGET_CPU=AMD64
'nmake' is not recognized as an internal or external command,
operable program or batch file.
os.chdir<'C:\\Cafu'>
scons: *** Error 1
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-27, 10:35

CloudVII wrote:Except after a minute or two, I got this:

Code: Select all

C:\Cafu> scons
scons: Reading SConscript files ...

os.chdir<'ExtLibs/wxWidgets/build/msw'>
nmake /nologo /f makefile.vc BUILD=debug SHARED=0 RUNTIME_LIBS=static COMPILER_PREFIX=vc10 TARGET_CPU=AMD64
'nmake' is not recognized as an internal or external command,
operable program or batch file.
os.chdir<'C:\\Cafu'>
scons: *** Error 1


Are you using VC 10 Express, or one of the full editions?

In any case, please edit file CompilerSetup.py and replace line

Code: Select all

envCommon=Environment();
with

Code: Select all

envCommon=Environment(TARGET_ARCH="x86");

Does that help?
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-27, 21:11

Yep, It worked! It compiled with no problems in about an hour.

Although I have one question, you mention having multiple build variants,
debug, release, and profile?
well, I noticed I only had Debug and Release, I don't have a 'profile' build.
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-28, 09:43

CloudVII wrote:Yep, It worked! It compiled with no problems in about an hour.

Ok, great to hear that!

Although I have one question, you mention having multiple build variants,
debug, release, and profile?
well, I noticed I only had Debug and Release, I don't have a 'profile' build.

Well, as the documentation says:
"This variant is not being built by default, you have to call SCons with the proper parameters or edit the CompilerSetup.py script in order to activate profile builds."
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-28, 16:37

Oh. I didn't see that. XD

Okay, Well I guess that means everything is up and running correctly.

Although I have one last question. How do I use custom materials/images? Like I was working on a level, when I opened the material browser, and realized there wasn't any images(Which I knew), so I went into the folder and realized that the pictures we're in a different format. (cmat I think?) is cmat a archive, like zip or rar, or is it a individual picture? if so how do I add my own images?
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-29, 14:17

CloudVII wrote:Okay, Well I guess that means everything is up and running correctly.

Yes! :cheesy:

How do I use custom materials/images?

cmat files are material script files, you can edit them in a text editor.

See http://www.cafu.de/wiki/#the_cafu_material_system for an overview.

(Future plans regarding the Material System include changing the cmat scripting language to Lua, and to include a graphical editor for creating and editing cmat materials. The latter will be part of CaWE and is planned to be implemented in the course of our work regarding the upcoming Model Editor.)
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-30, 18:25

Okay, Thanks.


Uhm, How hard would it be do you think, to replace, all the renderers, (Opengl, Direct X, and any other renderer you're using), with DirectX11?
User avatar
Carsten
Site Admin
Posts: 2103
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Setting up and compiling the source code

Postby Carsten » 2011-03-30, 22:02

CloudVII wrote:Uhm, How hard would it be do you think, to replace, all the renderers, (Opengl, Direct X, and any other renderer you're using), with DirectX11?

There is no need to replace renderers. Renderers are co-existing modules: Each renderer implements all Cafu rendering, using a specific technique or API. A new renderer for DirectX 11 would thus exist besides the other renderers; but when the program starts, it would be chosen and not another one to do the job.

So the real question is how to write a DirectX 11 renderer.
I don't expect this to be particularly difficult, but - contrary to my outline in the above paragraph - besides writing the renderer, it does require a one-time extra effort, because when the program window is created, care must be taken to properly initialize it for use by DirectX (rather than by OpenGL).

As a concluding remark, writing a DirectX 11 renderer is possible. It probably requires some patience, but is not expected to be overly difficult. On the other hand, consider that there is nothing that DirectX (11) can do that OpenGL cannot, so the question is why you would want to have a DirectX renderer in the first place. ;)
Best regards,
Carsten
CloudVII
Posts: 8
Joined: 2011-03-24, 20:04
Contact:

Re: Setting up and compiling the source code

Postby CloudVII » 2011-03-31, 20:10

I dunno, I'd rather have one Rendering program, instead of multiple. And I've never quite liked OpenGL(Dunno why). Thanks though. I'm definitely going to get to work on that.

Return to “Cafu Engine Support and Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest