Skip to main content

News

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Rahkiin

46
Engine Development / Re: Sphere 1.5, 1.6 beta
Yes well, I got it compiling with 1.8 :) I have no idea how it runs. I am still fixing code of Sphere itself: using Mac video but Unix system.
Also a lot of flags and stuff are different and, it is just generally different.

I accidentally refreshed so I lost quite a lot of my text (everything between fixing corona and fixing a lot of Sphere). :(

47
Engine Development / Re: Sphere 1.5, 1.6 beta
This is part 4 of my quest to building Vanilla Sphere for Mac!

In part 3 I tried to use the latest version of SpiderMonkey, which utterly failed because Sphere is extremely outdated. Instead I installed the ancient 1.8 version and it seems to pass that part.

Lets fix more errors!

The Audiere error was a mistake on my side: I forgot to include platform.h in audio.h.

I saw 4 warnings in script.cpp I could easily fix. One of the errors needs to be highlighted:

Code: [Select]

source/engine/script.cpp:5113:10: warning: result of comparison against a string literal is unspecified (use strncmp instead) [-Wstring-compare]
if (name == "")
         ^  ~~

Don't do this! I replaced it with:
Code: [Select]

if (name == NULL || strnlen(name,1) == 0 )


Next up: can't find libmng.h! :) So we can almost conclude that we are done with Audiere and JS.

Brew does not have libmng. http://sourceforge.net/projects/libmng/files/libmng-devel/ has two version: 1.x and 2.x. 2.x seems new: 2013. So we will go with the ancient version (like we did before).

Code: [Select]

cd libmng
./unmaintained/autogen.sh
./configure
make


BOOM! Error. jpeglib.h not found! Ofcourse, it should not Just Work (tm).
Try brew install jpeg, or use this: http://ethan.tira-thompson.com/Mac_OS_X_Ports.html

Code: [Select]

./configure --with-jpeg=/usr/local
make


Still does not work. I added /usr/local/include to DEFAULT_INCLUDES in the Makefile. And now it builds!
Code: [Select]

make
make install


Lets try SCons again. It works! And now we need to build Corona, which is the next complaint.
Get it from http://prdownloads.sourceforge.net/corona/corona-1.0.2.tar.gz?download

Code: [Select]

open corona-1.0.2.tar.gz
<wait>
cd corona-1.0.2
./configure
make

Oh it went so well... png.h not found.

Configure tells me that both png and jpeg cant be found and they therefor won't be supported. That is funny because it means MNG is an empty container :)
After some try-and-error:
Code: [Select]

CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include ./configure


Code: [Select]

OpenPNG.cpp:42:27: error: member access into incomplete type 'png_struct' (aka 'png_struct_def')
    memcpy(jmpbuf, png_ptr->jmpbuf, sizeof(jmp_buf));

Corona is outdated. The struct was removed in 1.5. I do have libs of 1.4 so I switch all the symlinks to libpng15 to libpng14.

Next up: errors when linking: duplicate symbols in libungif!

Derp i accidentally refreshed...
I don't want to rewrite all of it, so a quick rundown:
Fixed the duplicate symbols by removing the linking of libungif in one part (it got linked twice. Then libmng builds.

I had to fix a lot of Sphere by hand in code and the build system. These changes will all be up on the GitHub.

Most 'cant find lib' problems are because they don't look in /usr/local/, which is where all my brew stuff is placed, and almost everything else too.

11:36PM: I have: 'scons: done building targets.'! That is, using the mac video driver and the unix platform code. Lets try to run it.
I think it will fault.

Code: [Select]

Assertion failed: (sizeof(LAYER_HEADER) == 30), function LAYER_HEADER_AssertStructSize__, file source/common/Map.cpp, line 141.

Note to other developers: these assertions can be done at compile time using _Static_assert, if available.

For OSX, it now uses -std=c++11, so I can have static asserts. I then changed ASSERT_STRUCT_SIZE to use static assert when that is available. I also replaced size-sensitive typedefs in types.h to stdint.h types so it always works on 64 bit systems.

I also fixed more warnings and errors that came with the more strict c++11 :)

Lets run it again...
Code: [Select]

dlopen(/Users/jos/Development/SphereVanilla/sphere/sphere/build/mac/system/video/sdl32.so, 1): image not found


That is easy to solve: OSX has dynamic library extensions dyld, and I named them like that, and those files actually exist. So the dlopen call is using the wrong extension.
It is a value in the engine.ini.

And it crashes again:

Code: [Select]

dyld: lazy symbol binding failed: Symbol not found: _DGifOpen
  Referenced from: /usr/local/lib/libcorona-1.0.2.dylib
  Expected in: flat namespace


Honestly, I have no clue anymore. It is now 12:36AM. Committing code and pushing and then it is fine for today.

What I am doing though, is getting engine/mac to work by fixing its code. There's hoping.

This was part 4 of my quest to Building Vanilla Sphere for Mac. In this part I got quite some results: it actually builds. I fixed a lot of warnings and errors and made the build system much nicer, and made it work for OSX. Corona was and is a pain. I don't remember what more I did there, it got lost in a refresh.

The next part, part 5 already, of my quest will put some conclusion to it. I hope to reach my final destination (tm): a working engine. After that, I might go do a part 6, by starting on using Xcode projects and frameworks instead, so that a Sphere.app can be delivered.
However, I am not putting too much time in that as I am making my own engine, Andromeda, which is a completely other quest :)

The commits: https://github.com/sphere-group/sphere/commit/fb598fc58abb8374c856852681abfd2b686dcb45 https://github.com/sphere-group/sphere/commit/5d45b4e4572b46723661f91a7fca65d0b2145eab
48
Engine Development / Re: Sphere 1.5, 1.6 beta
There we are, with part 3 of our grand quest to building Sphere for Mac!

In part 2 we installed Audiere, which was a pain due to its dependencies. Then we configured the build to actually see audiere.h. Then I fixed mercurial for Mavericks and started its download. It is still busy. (That is, 7 minutes after posting my last post). Sigh.

So instead, I will fix the code of Sphere and its build configuration, to skip the examples and include the platform.h. If you are someone trying to reproduce what I do: you don't need to do this. I will update the project on GitHub.
I like where I put the include-flag for Audiere, so I keep it there, but I add a comment line for future maintainers.

Somehow, .o files are not excluded from git. Which is odd, because most often that is the first thing you add to gitignore. So I add a UNIX section and add *.o. Git status tells me that there is data in build/linux/docs. On github, it only has an engine.ini in linux/. Excluding the docs folder.
There seems to be some kind of database file for SCons: adding it do gitignore too.

I have seriously no clue how SCons works, but in the SConscript where I removed 'config', there already is a statement to add a folder in case of a unix build. I add an else clause and put config there. Now config is build on everything but Unix.
If another maintainer can tell me how I can add a clause specially for Mac, please :)

Now, HG tells me:
Code: [Select]

added 179880 changesets with 1008534 changes to 155940 files.

It does kind of explain why it took so long. (It is still busy 17 min after my last post).

Great, i accidentally deleted the mozilla directory because I put it in sphere/...
So I forgot to read the SM page, and it tells me: "To avoid downloading the full history, download the tar by clicking on tar at http://hg.mozilla.org/mozilla-central/file/tip". (Updated part 2)
For me, it is 168MB. Now is hoping that SM has a stable API and Sphere can use the latest version.

WARNING: Scroll below, because Sphere is so extremely outdated that it is not fixable for the newest SpiderMonkey. Below, we try to get an ancient (2009) spidermonkey running.

Untar the directory. I never understand the tar command, so i just open the file using 'open ...tar.gz'.
Code: [Select]

open *.tar.gz (name is dependent on last commit id)
cd mozilla-central<tab>
cd js/src


Mozilla tells me I can only use 1 specific version of autoconf: 2.13, and nothing later. Of course I have 2.68. Lets try it anyway.
Code: [Select]

autoconf

And No, it does not work. I think that on this quest, at least one thing has to be wrong with every step...

I must say I am surprised: homebrew tells me there is a 2.13 package for me!
Code: [Select]

brew install homebrew/versions/autoconf213

There was some link problem: I don't think it is a big trouble-file, so I renamed the standards.info to standards.info_bak.
Now that I have autoconf213, lets try it again.

Code: [Select]

autoconf213
./configure

What a fun: I have Python 2.7.2 but we need at least 2.7.3 (but not 3). Brew has python 2.7.6, so lets try:
Code: [Select]

brew install python
brew link python


After running above commands, I had to add the full python 2.7.6 path before ./configure
Code: [Select]

PYTHON=/usr/local/Cellar/python/2.7.6_1/bin/python2.7 ./configure


Now running make.
...
I almost can't believe it: no errors! I finished with make install.

Lets try SCons again on Sphere. Nope, it can't find SM.
Make install installed the headers in  /usr/local/include/-/mozjs-31a1/. Lets fix that by moving it to /usr/local/include/mozjs.
When SCons still can't find the headers, I discovered that it looks only in /usr/bin/mozjs and not in /usr/local/bin/mozjs. I added that searchpath too. I also added an error when it can't find the javascript engine.

So, running scons throws some errors (surprise!):
Code: [Select]

/usr/local/include/mozjs/mozilla/NullPtr.h:17:6: error: "clang version natively supporting nullptr is required."
/usr/local/include/mozjs/js/TypeDecls.h:23:10: fatal error: 'js-config.h' file not found

It also throws a bunch of warnings about C++11. The first error tells me I need to activate C++11 in clang. I added -std=c++11 to the compiler flags for linux, but again, this should only be done when using Clang. But I have no clue how to do that. Maybe other do.

The c++11 switch dismisses a lot of warnings, and the first error. Now, the second error.
For some reason, make install did not install js-config.h. I am lazy and copy it by hand.
Code: [Select]

cp mozilla-central/js/src/js/src/js-config.h /usr/local/include/mozjs/
scons


I forgot to platform-erize network.hpp (I will push this to GitHub ofcourse), solving an error.

Now, I am going to cry for a bit: I see a lot of errors coming from the Sphere engine code about missing JS declarations. Three of them:
Code: [Select]

source/engine/ss_functions.table:6:1: error: unknown type name 'JSBool'
source/particle_engine/ScriptInterface.hpp:87:41: error: use of undeclared identifier 'JS_TRUE'
source/engine/ss_functions.table:16:1: error: unknown type name 'uintN'


It seems JSBool has become bool, JS_TRUE becomes true and JS_FALSE becomes false. That is an easy fix.
The documentation does not say anything about removing uintN: instead, it is noted that uintN is the native unsigned int, and intN is the native int. So I replaced those.

Next problem: JS_AddRoot is gone and made place for more specific functions, as seem https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_AddRoot.

Ok, I think I give up on refactoring all of Sphere's javascript code... The documentation does not event seem to match the current code.

I am rolling back the changes I made to the code, and instead am going to try to get the VERY old SpiderMonkey: from 2009. version 1.8.
Code: [Select]

wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz
tar xvzf js-1.8.0-rc1.tar.gz
cd js/src
make BUILD_OPT=1 -f Makefile.ref


Wow, not even a configure! It also fails. Something about assigning to va_list. I know that clang supports va_copy, so I forced that in the faulting file.
Code: [Select]

//#ifdef HAVE_VA_COPY
#define VARARGS_ASSIGN(foo, bar)        va_copy(foo,bar)
//#elif defined(HAVE_VA_LIST_AS_ARRAY)
//#define VARARGS_ASSIGN(foo, bar)        foo[0] = bar[0]
//#else
//#define VARARGS_ASSIGN(foo, bar)        (foo) = (bar)
//#endif


There is no make install, so I did the stuff below to make it work:
Code: [Select]

mkdir /usr/local/include/js
cp js/src/*.{h,tbl} /usr/local/include/js
cp js/src/Darwin_OPT.OBJ/*.h /usr/local/include/js
cp js/src/Darwin_OPT.OBJ/libjs.* /usr/local/lib


Then Sphere built a bit more for me: it now gives me an error on Audiere :(

In this part I tried to get the most up to date SpiderMonkey to run. I achieved that (try the js command) but sadly, Sphere is so outdated that its API is nearly not convertable: at least not in a couple of hours. Instead, I build and installed-by-hand the ancient SpiderMonkey.
In part 4, I will be fixing more errors and I will probably meet the missing Corona and LibMNG.
49
Engine Development / Re: Sphere 1.5, 1.6 beta
Building Sphere for OSX: Part 2.

This is part 2 of my adventures, when building Sphere Vanilla from source, for Mac OSX Mavericks. In the previous chapter, I downloaded the sources, installed wxWidgets and changed configurations to exclude the config app (wxMac is broken). I then updated source code of Sphere to fix a lot of warnings and platform errors. (I push these so you don't have to).

If you ever want to reproduce this: sorry for the hasty texts, but when building such a horrible thing, one does not want to write every step down cleanly.

So I downloaded Audiere. It has some odd build system. But i started with ./bootstrap. It told me I had no libtoolize.
A brew install libtool solved that, except I already had libtool. Therefor I symlinked libtoolize to glibtoolize (because brew renamed its packages to not cause conflict.)
Now bootstrap worked, and it generated configure. Running configure succeeds, at try one! Time for make.
Yeah! It has an error! Someone forgot to include stdlib for malloc in utility.h.
Next, error: undeclared identifier wxOPEN. So what is an audio-lib doing with WxWidgets?
It seems to be one of the examples. Fine: remove it from the build. (Makefile SUBDIRS). Done :)
Running make install to install the library.

I fear for Corona...

But first, running 'scons' again on sphere. Surprise: it does not find audiere.h. So I add -I/usr/local/include to the compiler construct, next to -DNO_WRITE_MNG (because I am lazy and have no clue how SCons works).
Now it continues.

Next up: can't find jsapi.h.
It would be cool if such a package with thousands of dependencies could just deliver these dependencies too..
Googling that file sends me directly to SpiderMonkey. I am going to build it from source.

EDIT: In part 3, I discover that downloading the whole tree with history can be avoided by downloading a tar. http://hg.mozilla.org/mozilla-central/file/tip and click on tar at the top. I tried to download with HG so you will find my adventures below. Just don't try it at home (tm).

First, my HG is screwed up due to the Mavericks update, so reinstalling that using brew. After doing a brew doctor and brew link overwrite, HG works again.
Mercurial is surprisingly slower than git... (already waiting 15min)

In part 3 we will be continuing our quest to build Sphere for Mac! We will start by building SpiderMonkey. Because HG takes ages, I might first update gitignore and the buildfiles to skip the config. And then I will push that to git.
50
Engine Development / Re: Sphere 1.5, 1.6 beta
Part 1 of my quest to building Sphere for Mac.

In this quest, I will be trying to build (Do or do not, there is no try -- Yoda) building Sphere for Mac from source. I will explain everything I do so that 1) It becomes a funny story, 2) I can be judged about how much I suck at SCons, 3) Others can reproduce what I do and build Sphere themselves.
Some parts will not need to be reproduced because I put them on the git repo.

First, a git clone of the sphere repository.
It seems Sphere uses some obscene building system called SCons, so installing it from the website.
Then scons nags about sdl, so I install SDL2 with brew install sdl2. Seems I needed SDL1, so installed that.
Then it started about wxWidgets, presumably needed for the config program. Installing that.
But even after installing wxWidgets, it does not build the config because wxMac is broken, kinda. Instead, I removed config from the build. (I will push this to the repo. Nobody needs that silly program anyways.)

Executing scons once more:

Code: [Select]

source/engine/video.hpp:11:2: error: unsupported platform
#error unsupported platform


Seems that you failed to use the correct macros on platform-specific stuff. So I fixed that using information on this page: http://sourceforge.net/p/predef/wiki/OperatingSystems/

I created a platform.h in common/ that generates macro-definitions for all platforms (we use). Then I include that file where it is needed. Now the checking for compiler stuff is in 1 place and can be easily updated. Example for video.hpp:

Code: [Select]

#include "platform.h"

#if SPHERE_WIN32
# include "win32/win32_video.hpp"
#elif SPHERE_MAC_OSX
# include "mac/mac_video.h"
#elif SPHERE_UNIX
# include "unix/unix_video.h"
#endif


(Sidenote, the use of '../common' everywhere is useless, as common is included in the search path. At least, here it is.)

By defining the SPHERE_* macros as 1, we can use a simple #if and #elif, because a non-defined macro is 0. Cleans up :)
I also included compiler macros: SPHERE_MSC, SPHERE_CLANG, SPHERE_GCC, SPHERE_MYNGW.
And then I added SPHERE_STDCALL that only expands to __attribute__((stdcall)) on SPHERE_WIN32. It cleans up dozens of warnings on my side.
I can't confirm the working of the platform macros that are not SPHERE_MAC_OSX. I will push it: please (@FlyingJester) try it out on your Gentoo machine and @Radnen/@Neo try it out on windows. :)

It builds! Until it tells me it can't find audiere.

In the next part of our quest, part 2, we will build Audiere and see what else crosses our road.
51
Projects / Re: Spectacles: Bruce's Story
Too bad there is no working Sphere engine for OSX. I would really like to play it.
52
Engine Development / Re: TurboSphere
There is the D8, the debugger for V8. Works just fine. You just connect to the app and you can set breakpoints, do traces etc.

Also, multiple isolates is not that hard, the problem will be the multiple opengl contexts I think.
53
Hellos and Byes / Re: has anything evolved?
Engine developers are working on creating a modern API and related game engines for Windows, Linux and Mac OSX. That is about it.
54
It seems the forums don't like me and hide MANY unread.... oh wait. It seems I had general topic collapsed :/

First, the design looks very very nice!
And I would really love an IMDB for Video Games. And then make it like IMDB too: so good searching, list of reviews, polls, lists, Wishlists, New releases, future releases, and star ratings.
You really NEED 'related video games' (data mining required).

Also add social stuff (Twitter,Facebook G+) and links to Steam, XBLive, and so on. Maybe some of them even have APIs to pull some data. (If the license allows that) to create game pages with nearly no content.
I think it is better when I would find a game on it but with no icons, screenshots, ratings or any other metadata, than to Not find the game at all.

About the domain: try to contact the owner of the domain and ask what their plans are and see if you can buy it. Talk about how bad/sad it is for the internet to have empty domains and do not talk about making money of the domain. Tell them you are hobby-ist so they don't go asking millions.
I once wanted to buy jarvix.com, and they called me for an offer of 500,000$ lol.

Good luck!
55
Engine Development / Re: Sphere for Mac: Andromeda
I would like to make a small notice:

Sphere for Mac, before also called JSphere (by me alone), is from now on called: Andromeda. And it implements the Pegasus API. (They are both constellations :D)

// Rahkiin
56
Sphere Support / Re: How do you use sockets?
I do like to point out that HTTP is easier than IRC. You just connect, write the HTTP GET header and then read the response :) Just some string processing. But eh. :)

Good luck!
57
X86 applications run natively, but they can't use some new stuff. Chrome used to run in 32 bit, IIRC. AFAIK, I don't see any 32 bit programs running on my system now. There is just no reason to run in 32 bit :P
On windows and linux, there are reasons to do so. Mostly way-back-legacy and poort universal packaging.
58
The OSX platform is almost only updated for the 64 bit software. It means that any new programs will be compiled to 64 bit, and that the new libraries only exist in 64bit. The fragile Objective-C ABI is also 64 bit only, and a lot of optimizations is 64bit only. When writing for OSX, it is mostly 64bit only nowadays.
59
I quickly looked at his code. For any seasoned programmer it is very readable :)

Thanks for posting!
60
What error does it give, exactly?