Crystal Space
Welcome, Guest. Please login or register.
April 16, 2014, 08:17:03 am

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7579 Members
Latest Member: Brianmatthews
* Home Help Search Login Register
  Show Posts
Pages: 1 [2] 3 4 ... 7
16  Associate Projects / CEL Discussion / How to realize entity-scripting and quest-scripting with Python? on: September 20, 2005, 09:46:52 am
Most games like Morrowind etc have an own scripting language. We want to embed python for this reason.

I would like to know how to realize entity-scripting with python.
The only condition is that all behaviours (however they are written) must use a BehaviourCommon class (written in C++) as parent class. (This class sends the received messages over network, that's the reason)
The entities will be created by C++ too.

Is it still possible to attach behaviours written in python (but derived from BehaviourCommon) to these entities? (Or isn't that mixup a good idea?)
Can I use CEL's cel.behaviourlayer.python plugin or should I use swig and create an interface to my BehaviourCommon class?

Another question is, if it's possible to use the builtin questsystem from python.

(writing everything in C++ is the easiest way - damned team-scripters *g*)
17  Crystal Space Development / Support / Re: Compile Errors on: September 20, 2005, 08:20:14 am
recently there are some mails in the mailinglist about the soundsystem and directx.
1) CS gets/has a new soundsystem (checkedin since yesterday)
2) it seems that soundcode written for directx 7 is not compatible with directx 8,9 or something like that

You can try the latest CVS sources to try the new system or downgrade directx.
You even may ignore the errors, because you said that you won't use the directx plugin, so you don't have to care if it's not been build.
18  Crystal Space Project Development / Feature Requests / Re: ability to use other graphic engines on: September 20, 2005, 08:14:03 am
you want to export the CS engine with blender to ogre??  I don't understand what exactly you want...
Do you want a csplugin that renders graphics with ogre or do you just want a fileformat-converter to convert a cs xml-mapfile into a format ogre understands?
19  Associate Projects / CEL Discussion / Re: Loading map with CEL fails (zonemanager) on: September 19, 2005, 09:54:30 pm
HEUREKA! That's it. I appended an initialize function to my lib, that calls csInitializer::InitializeSCF(argc, argv) and call that function in Application(). Now it works.
1000 Thanks, that is better than Asperin Cheesy
20  Associate Projects / CEL Discussion / Re: Loading map with CEL fails (zonemanager) on: September 19, 2005, 06:00:15 pm
Yes, I use that in my main-app.
The Maploader is inside a shared library though. There I use CS_IMPLEMENT_FOREIGN_DLL.
21  Associate Projects / CEL Discussion / Re: Loading map with CEL fails (zonemanager) on: September 19, 2005, 11:33:35 am
hm, the Maploader-class is outside my main-application (and doesn't even know the mainapp, I just give the objectRegistry to it), maybe that's the cause that these prerequisites are not met.
But what do I have to do to give access to csStaticVarCleanup and SCF so that GetID() works?
22  Associate Projects / CEL Discussion / Re: Loading map with CEL fails (zonemanager) on: September 19, 2005, 08:39:01 am
ok, I'll step through the code:
new Maploader() is not NULL (that's that's asserted too)

entering loadMap():
vfs->ChDir is ok (it's mounted as maps.zip in workdir+"$/share$/maps.zip", GetMounts() lists it as "/maps.zip/" and it's found. The file includes only one mapfile, with the filename "world". the loadMap-parameter csString map is "world")
mapEntity is not NULL after CreateEntity
method calls from CEL_QUERY_PROPCLASS_ENT (mapEntity,iPcZoneManager):
-> celQueryPropertyClassEntity(iCelEntity*)           (propclas.h, 518)
-> celQueryPropertyClass(iCelPropertyClassList*)
-> FindByInterface(GetID(), GetVersion())                (propclas.h, 496)
-> SCF_VERSION(iPcZoneManager, 0, 1, 1);         (zone.h, 201 -- entered by scfInterfaceTraits<iPcZoneManager>::GetID())
-> segfault

Assemblercode for SCF_VERSION(iPcZoneManager, 0, 1, 1):
push %ebp                        (step ok)
mov %esp, %ebp             (step ok)
push %ebx                         (step ok)
sub $0x14, %esp              (step ok)
call 0xb7e25564 <__i686.get_pc_thunk.bx>           (step ok)
add $0x34630, %ebx                (step ok)
-> back to SCF_VERSION(iPcZoneManager, 0, 1, 1) -> next step segfault

(This is what the backtrace from above says too, I can't find out more - or at least I don't know if/how I can find out more *g*)
23  Associate Projects / CEL Discussion / Re: Loading map with CEL fails (zonemanager) on: September 18, 2005, 07:35:07 pm
A clean build doesn't help and valgrind doesn't bring useful information or errors.
So let's check what I need/have:

Requests and Queries for Engine, VFS, Null3d, Imageloader, Levelloader, Reporter, ~listener, PlLayer, BlLayer.Test (not in use yet (and will be replaced), but registered with Physlayer).
Now I'm mounting my mapfiles etc; they are found.
Now I create the maploader which (see code above) and then I load a specified mapfile.

Is something missing? Can it fail because something is wrong with the mapfile or textures are missing or something like that?

The last thing in the backtrace is "scfInterfaceTraits<iPcZoneManager>::GetID ()"
Maybe the error is outside my code?
24  Associate Projects / CEL Discussion / Loading map with CEL fails (zonemanager) on: September 18, 2005, 12:21:51 pm
I am trying to load a mapfile with CEL as described in the celtut chapter 3. I'm using an own class for this:

Code:
Maploader::Maploader(csRef<iObjectRegistry> objectRegistry) {
    this->obreg = objectRegistry;
    this->pl = CS_QUERY_REGISTRY (objectRegistry, iCelPlLayer);
    this->vfs = CS_QUERY_REGISTRY (objectRegistry, iVFS);
    this->mapEntity = NULL;

    if (!pl->LoadPropertyClassFactory ("cel.pcfactory.zonemanager")) {
        csPrintfErr("ZONEMANAGER!\n");
    }
}

bool Maploader::loadMap(csString map) {
    vfs->ChDir("/maps.zip");
    mapEntity = pl->CreateEntity (map, 0, 0, "pczonemanager", 0);
    if (!mapEntity) {
        csPrintf(csString(gettext("map_load_error"))+map+"!\n");
        return false;
    }

    csRef<iPcZoneManager> zonemgr = CEL_QUERY_PROPCLASS_ENT (mapEntity,iPcZoneManager);
    iCelZone* zone = zonemgr->CreateZone ("main");
    iCelRegion* region = zonemgr->CreateRegion ("main");
    zone->LinkRegion (region);
    iCelMapFile* mapfile = region->CreateMapFile ();

    mapfile->SetPath (map);
    mapfile->SetFile (map);
    return true;

the line "csRef<iPcZoneManager> zonemgr = CEL_QUERY_PROPCLASS_ENT (mapEntity,iPcZoneManager);" segfaults, but everything before is ok: mapEntity is created, no errormessages appear.

Why can't the zonemanager be queried? I don't understand...

Backtrace is
Code:
#0  0xb7e15231 in scfInterfaceTraits<iPcZoneManager>::GetID () at zone.h:201
#1  0xb7e1516b in celQueryPropertyClass<iPcZoneManager> (plist=0x8220ee0)
    at propclas.h:496
#2  0xb7e14fe6 in celQueryPropertyClassEntity<iPcZoneManager> (
    entity=0x8220ed0) at propclas.h:518
#3  0xb7e1445f in Maploader::loadMap (this=0x821fbb0, map=
        {<csStringFast<36>> = {<csStringBase> = {_vptr.csStringBase = 0x80ae668, Data = 0x0, Size = 5, MaxSize = 0, GrowBy = 64}, minibuff = "world\000\000\000�f\"\b\000\000\000\000\b�f\b�$�004\bh!\b\200�n\b", miniused = 6}, <No data fields>}) at Maploader.cpp:45
25  Crystal Space Development / Support / Re: Bug? Comparing an element of csStringArray with const char* doesn't work? on: September 15, 2005, 02:43:31 pm
nice to know grin
csArray<csString> is what I need in this case. Thanks for the answer.
26  Crystal Space Development / General Crystal Space Discussion / Re: A stupid question on: September 15, 2005, 02:08:46 pm
Impossible, how should that work? CS uses OS/system functions and library functions, it's a lib and no OS
27  Crystal Space Development / Support / Bug? Comparing an element of csStringArray with const char* doesn't work? on: September 15, 2005, 01:54:58 pm
I'm using a csStringArray and want to compare the strings it contains:

Code:
csStringArray datenArray;
datenArray.Push(csString("netcmd"));
if(datenArray[0]=="netcmd") {...}

But: The comparision inside the if-statement returns false!
I checked datenArray[0] with csPrintf and it's right.
The comparision only works after I initialized another csString with datenArray[0]:

Code:
csStringArray datenArray;
datenArray.Push(csString("netcmd"));
csString xxx = datenArray[0];
if(xxx=="netcmd") {...}
this works! Why?

I know that csStringArray::operator[] returns a csString& and csString has operator==(const char *Str) const so this must be a bug - or what?
28  Crystal Space Development / Support / Re: Problems with reading an xml-file on: September 13, 2005, 09:58:37 pm
Thanks this works.

I wonder why a node with more than one attribute needs an iterator loop and cannot use node->GetAttribute("Foo") more than one time. The API doesn't say that GetAttribute cannot be used more than once for each node. I'm just curious, maybe it's a bug =)
29  Crystal Space Development / Support / Problems with reading an xml-file on: September 13, 2005, 06:19:34 pm
I want to read a xml file that I created. The file is very simple and I don't know why the following code doesn't work:

Code:
csRef<iFile> file = vfs->Open("config.xml",VFS_FILE_READ);

if (file.IsValid()) {
   csRef<csTinyDocumentSystem> xml = new csTinyDocumentSystem();
   csRef<iDocument> document = xml->CreateDocument();

   if (!document->Parse(file)) {
        csRef<iDocumentNode> rootnode, sectionnode, node;
        csRef<iDocumentAttribute>attribut;
        csRef<iDocumentAttributeIterator> attribIterator;

        rootnode = document->GetRoot();

       sectionnode = rootnode->GetNode("Section");
       assert(sectionnode);
...

assert and debugger say that sectionnode is NULL but it shouldn't be NULL.

This is my xml-file:
Code:
<?xml version="1.0"?>
<Root>
        <Section>
                <!--
                        comment
                 -->
                <node attr="0"/>
        </Section>
</Root>

GetRoot() should give me access to <Root> and from there I should get access to <Section> and from there I should get access to <node> and it's attribute, but GetNode() returns nothing, deleting the assert() will cause a segfault.
What's wrong here?
30  Crystal Space Development / Support / Small question and some tips about CFLAGS and CS on: September 12, 2005, 11:10:27 pm
Are custom CFLAGS and CXXFLAGS recognized by the buildsystem? I cannot check this because jam suppresses compiler messages and I don't know what else the CS buildsystem does. (yes, configure tells me about these flags but this doesn't mean that they are actually used)


btw:
"-march=i686 -O3 -ffast-math -fomit-frame-pointer" as maximum optimization is far,far away from "optimal" and far away from maximum too.

Some tips for your buildsystem:

1) You can use -mtune=foo instead of -march=foo. This doesn't break the build for other cpus but optimizes for foo
2) i686 is the flag for the stone age Intel Pentium Pro CPU with 200MHz. No Gamer even with an old PC uses that today (and most people bought pentium-mmx instead of pentium pro that time). Use pentium3 for max and pentium2 or pentium-mmx for min optimization. "pentium3" is the base flag for p3, p4, athlon, athlon xp and opteron, which are in use by most people today. How old is Pentium Pro? 10 years... These guys may even use a voodoo 1 graphics card if lucky, I don't think that's enough for complex games. OK, they may use CS as library for non-game-stuff. That's the case for mtune...
3) use -pipe. This reduces compile time because it uses RAM instead of harddisk for tempfiles (ok, for a real fast compilation you should use ccache -> complete CS in 3 minutes, but that's no compile flag)
4) -ffast-math "should never be used since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions". I guess that this is important for all the graphical math in CS.
5) -fomit-frame-pointer is enabled at levels -O, -O2, -O3, -Os, so you can leave it
6) You can use -fforce-addr, -funroll-loops, -fprefetch-loop-arrays for loop optimizations and use of memory addresses in registers

Another tip:
-Wl,-z,now as compile flag.
This tells the linker to load the symbols when the program is started. This slows down starting but speeds up execution. Most games need some time for loading and execution must be fast, so that's the right flag for CS, I guess.

Documentation:
-> http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
-> http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/Optimize-Options.html#Optimize-Options
-> man gcc
-> man ld
Pages: 1 [2] 3 4 ... 7
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.139 seconds with 16 queries.