RE: [GD-Consoles] question: Embedded scripting language on console
Brought to you by:
vexxed72
From: Andrew P. <aj...@eu...> - 2003-02-21 11:30:34
|
Thanks Tom. Its good of you to spend the time giving such a detailed reply. Given your experience, it is certainly something I will look into here. Have you know what sort of memory footprint this takes up? Cheers, Andrew -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Tom Forsyth Sent: 20 February 2003 11:23 To: gam...@li... Subject: RE: [GD-Consoles] question: Embedded scripting language on console Bear in mind that the project is only about a third of the way through, so we haven't hit any evil crunch times yet. Porting was pretty simple. You need to override the memory handling stuff to use your own heaps of course, but that was pretty simple. You also probably want to give Python its own heap because it does a lot of 12-byte allocations, and if you throw that in the general heap you'll get horrible fragmentation. We used a stack-based allocator hard-coded to deliver 12-byte entries - nice and fast, no fragmentation. Biggest worry is speed on the PS2, because its cache is sooo tiny. But Python is hardly a speed demon in the best of times, so you need to make sure you're not using a "heartbeat" system (i.e. calling each object each frame) - you need a queue-based event system and a C "autonomic" system to do the mundane work. This is just good programming practice, whatever language you use, but it's especially important when using a slow scripting language for your high-level stuff. SWIG takes a bit of work to integrate into the toolchain, and it's still not great - it doesn't auto-SWIG headers very well, and we do tend to have to manually do a "SWIG rebuild" quite often. However, it is pretty fast, so that's not a big problem, it's just a bit annoying. I suspect we could fix it easily if we just wrote a makefile (rather than trying to use VC.net's stuff, which isn't very suited to this sort of stuff). Benefits are that Python is incredibly easy to code, and we've got some good stuff up and working very quickly. And of course you get a scripting language that the designers can use "for free". Yes, it's a brave step. But we know that if it does all fall down around our ears and speed is a big problem, we can just port the code back to C, and only use Python for actual "level scripts" (this switch opens this door, stuff like that). SWIG is probably the most important bit of the puzzle, because it means that you can freely mix and match Python and C - they can access each others members and fucntions quite happily, which means you can throw code from one to the other in case of speed emergencies. But we've not had to so far. Even if the worst happens and no trace of Python survives to the shipped game (which I very very much doubt), Python is a great prototyping tool. We were inspired by Humungous's work with Python and SWIG - they've definately had more experience with this sort of stuff. IIRC, there's a GDC talk they did on the pros and cons and gotchas. Definately worth checking out. Tom Forsyth - Muckyfoot bloke and Microsoft MVP. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Andrew Perella [mailto:aj...@eu...] > Sent: 20 February 2003 10:54 > To: gam...@li... > Subject: RE: [GD-Consoles] question: Embedded scripting language on > console > > > Hi Tom, > Can you tell us more of your experiences with using > python on ps2/xbox/gc? > What problems have you had? What unexpected benefits did you get? What > worries do you have at the back of your mind? My feeling is > that this was a > brave step to make at this time. > Regards, > Andrew > > > Dr Andrew Perella > Programming Manager > aj...@eu... > > Eutechnyx Limited is a Deloitte & Touche Fast 50 and a Sunday > Times Tech > Track 100 company. > > Eutechnyx Limited > Metro Centre East Business Park > Gateshead > Tyne & Wear > NE11 9HU > UK > Phone: +44 (0) 191 460 60 60 > Fax: +44 (0) 191 460 22 66 > www.eutechnyx.com ------------------------------------------------------- This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The most comprehensive and flexible code editor you can use. Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. www.slickedit.com/sourceforge _______________________________________________ Gamedevlists-consoles mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-consoles Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=553 _____________________________________________________________________ This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322 _____________________________________________________________________ This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322 |