FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Python and C++  (Read 3123 times)

punkbohemian

  • Guest
Python and C++
« on: March 07, 2012, 10:26:23 pm »

I've been tinkering with python with the intention of doing some game development down the line, and thought I would ask a question about FIFE. I read that you are using Python for scripting, but C++ for graphics management. I hear this is a pretty common thing as C++ is more efficient at runtime, a handy trait for something graphic intensive. However, do you think it matters on a project like FIFE? That is to say, the FO games weren't that much of a burden on my system when they came out. Now, many years later, I wouldn't think it would matter with which language you build. It's relatively unintensive graphically, so python/pygame/SDL could get the job done, work just as well, and with less coding. But, I'm just a beginner, so I could be totally off. That's why I'm asking. Thanks.
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: Python and C++
« Reply #1 on: March 09, 2012, 01:28:03 am »

It does matter :-)

All modern Python gaming related libraries that I know have outsourced time critical code (mostly rendering related) to a C or C++ library that they interface with.

Fallout had a bunch of low level optimizations. These were necessary to get the game working at the desired framerate. I remember reading a document about light implementation in Fallout and AFAIR it used some nifty algorithm that used the hex grid as starting point and used it for lighting purposes.
Logged

prock

  • Developer
  • Full Member
  • *
  • Posts: 236
    • View Profile
Re: Python and C++
« Reply #2 on: March 11, 2012, 12:20:28 pm »

Hi punkbohemlan,

That's correct, FIFE isn't hugely intensive on the graphics side of things but it does provide a lot of things that SDL, pygame and the others don't.  These include map loading/saving routines, pathfinding, object sorting and render order, animation, etc etc.  The list can get pretty long.  So as I said you could use pygame or any of it's counterparts but you'll be missing the game framework to get you going.  Hope this helps,

prock
Logged

punkbohemian

  • Guest
Re: Python and C++
« Reply #3 on: March 12, 2012, 09:32:47 pm »

I wasn't aware that FIFE also included pathfinding and map loading/saving. I only recently started reading about the project. That's cool.

Now, I've read in other threads that FIFE is pretty flexible and modular. I also understand that it's inspired more by FO1+2, than other games in the series. What I'm wondering is how well it would adapt to being utilized in a system more akin to FOT. Some of the features to which I am particularly referring would be the continuous turn based (i.e. real time) combat, stances (standing, crouched, prone) with applicable modifers. Basically, my eventual goal is to create a mod, but using FOTs gameplay, though I'm less concerned with some of the party features like being able to control every other character's action. Can FIFE do that? Thanks.
Logged

rivon

  • Newbie
  • Posts: 26
    • View Profile
Re: Python and C++
« Reply #4 on: March 13, 2012, 04:11:39 pm »

Fallout Tactics game is no problem with FIFE.
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: Python and C++
« Reply #5 on: March 17, 2012, 08:29:18 am »

I wasn't aware that FIFE also included pathfinding and map loading/saving. I only recently started reading about the project. That's cool.

Now, I've read in other threads that FIFE is pretty flexible and modular. I also understand that it's inspired more by FO1+2, than other games in the series. What I'm wondering is how well it would adapt to being utilized in a system more akin to FOT. Some of the features to which I am particularly referring would be the continuous turn based (i.e. real time) combat, stances (standing, crouched, prone) with applicable modifers. Basically, my eventual goal is to create a mod, but using FOTs gameplay, though I'm less concerned with some of the party features like being able to control every other character's action. Can FIFE do that? Thanks.

In addition to rivons post here some additional infos:

In FIFE, things like "standing, crouch, prone" are not hardcoded - as those are only "actions" defined by you - and which are linked to certain animation files.

There is also no combat model hardcoded in FIFE, as it doesn't exist. That's the clients job to implement a fitting management of all participants of a combat session.

Maybe this example will help you to understand what FIFE does (in this regard, combat + entity handling) for you, and what you have to add in your (python) code:

- you create a map, design it by adding ground floors, your buildings, your 'agents' (npcs, critters) etc. - internally those are ALL FIFE Instance objects
- assign unique identifiers to the objects you want to work on your code with
- in your client, ask fife to give you a particular object by handing over the unique id
- voila, you now can control this instance. If it has action (is animated), you can ask FIFE to play a certain action

It's totally up to you what you do with this control - you can e.g. write code to let an instance behave like a locker (open door, close door etc.) - or you can write code to let it act like an npc.

And of course, there is so much more - prock already mentioned a few of them already. You can do a lot of stuff with FIFE, you just have to write the propper "managing code". That's why FIFE is so flexible, and that's why you can create all kinds of (isometric / topdown 2D) games with it - be it an RTS, a cRPG, a Jump'n Run (see the shooter demo in demos/shooter), a card game etc...

Good luck with your project - and in case you give FIFE a try - don't forget to stop by at the IRC channel if you run into problems =)