Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Embedded Python Debugger


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 ManixReaper   Members   -  Reputation: 571

Like
0Likes
Like

Posted 18 June 2012 - 05:01 AM

I'm having some difficulties with my current project and was hopeing that I could get a little feedback on the issue of Embedded Python Debugging for games.

My project is written in C++ with Ogre3D graphics engine. I have embedded Python in the project and have done some nice things like getting the program to break when there is an exception in python, printing out errors and callstacks etc, But I am getting to the stage where debugging by print statements is just getting too slow and laborious. I have tried intergrating winpdb (http://winpdb.org/ ) into my project, but I find it to be unuseable (I hate having to connect to the process every time I launch, and it doesn't catch exceptions).

So my question is this, has anybody else embedded python in a game with a useful graphical debugger with it? I basically want something along the lines of Lua Tilde for my project.

At the moment, I'm thinking that I might have to write my own GUI Python Debugger and change the structure of my program to read from sockets that it will connect to, but before I dive in the deep end I was hopeing that somebody had a better solution.

Thanks

Sponsor:

#2 ColinDuquesnoy   Members   -  Reputation: 1141

Like
1Likes
Like

Posted 18 June 2012 - 06:09 AM

I'm curious to know too.

As you, I haven't found any easy solution for debugging my embedded python code and as I didn't wanted to go into creating my own GUI debugger I've changed my way of doing: instead of embedding, I decided to go with extending python. This approach allow me to fully debug my python code (using Pycharm debugger) and lead to a better working environment (I can still debug the c++ code using "attach to process" with CodeBlocks or KDevelop or by supplying the python executable and the main script as the project host executable).

On the performances side, I didn't notice any major performances drop going from embedded to extended (using AMD CodeAnalyst, calls to python dll remains under 0.1% (more or less what I had when embedding)) but that will depend on your specific case.

Extending python is probably the easiest way to go: you write and test performance critical systems in c++ (renderer,scene management) and you write and debug top level object (game states, component/entity system) in python from python.

#3 ManixReaper   Members   -  Reputation: 571

Like
0Likes
Like

Posted 18 June 2012 - 09:11 PM

I hadn't thought about extending. But at the moment, to get either it extended or writing a debugger would probably take just as much effort, so I'm leaning towards writing a debugger (also, it sounds interesting as I haven't done anything like that before). But before I dive in, I want to just make sure I am not reinventing the wheel!

Judging from the fact that nobody has already mentioned an alternative, I'm guessing that there isn't must out there to use?

#4 ColinDuquesnoy   Members   -  Reputation: 1141

Like
1Likes
Like

Posted 20 June 2012 - 12:05 PM

to get either it extended or writing a debugger would probably take just as much effort


Probably not. Extending is just a matter of entry point.
If you can translate your main entry point from c++ to python, you're done.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS