Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
wallabra

Python Doom?

Recommended Posts

I was thinking 'bout coding something Doomy using Python, so that it could import my bot codes that are written in Python. It is quite moot to use Python to code bots for current source ports.
Another alternative would be a source port that includes a bot behaviour editor by itself, with a interface similiar to Scratch or Unreal Engine 3's Kismet where you put conditions at which the bot behaves, and when and where it will plop walk nodes, run nodes, use nodes (preferably at the player position, orientation and height), and etc. Or a standalone editor would be useful too, but they're for another thread (moderators, please?).

Specifically, I want to do either:

  • A source port built in Python. It would be harder to code, but it could be based in any good source port and it would support any IWAD. Also it could load Python bots (but I don't know how to import from pointers in Python).
  • A entire Doom-based game in Python. It is easier to code but if it's not based in id Tech 1, then it can't load other IWADs, even though it still can import my Python bots. Preferably, if it's going to not use id Tech 1, then it will come with a inbuilt map editor, bot behaviour editor and 3D floor and ramp support in it's original form. (This means OpenGL!)
Any suggestions to make this better? I need to have this done, my deadline is February 1st, 2020. Anyone want to join this team and provide contributions to the code?

GitHub
IRC: irc.zandronum.com @ #pythondoom

Share this post


Link to post

Shouldn't this idea be posted in the Source Ports section?

Also, the source port idea seems more efficient and less time consuming rather than the the whole Doom remake.
Someone is making a Doom 2 remake in Unreal Engine 4. Its still in alpha.

Where's GhostlyDeath when you need him? He can give a better idea than what I said.

Share this post


Link to post

If you are serious about this, then PyDoom really seems to be the missing link. It's not uncommon for commercial games to have a "core" written in traditional/hardline programming language (their nuts & bolts, so to speak), while "softer" behavior-specific stuff like game logic, scripting is writing in an external interpreted language like Python or Lua.

Since bot (and scripting behavior) in general is limited by what the scripting language can express, full-fledged Python would be a major step up from any existing scripting systems used in Doom source ports. And since there's already something like that in the works, it's unlikely anyone would bother starting a duplicate/parallel effort.

Share this post


Link to post
Gustavo6046 said:

A entire Doom-based game in Python. It is easier to code but if it's not based in id Tech 1, then it can't load other IWADs, even though it still can import my Python bots. Preferably, if it's going to not use id Tech 1, then it will come with a inbuilt map editor, bot behaviour editor and 3D floor and ramp support in it's original form. (This means OpenGL!)


Seeing that your repository license is CC0 1.0 Universal (effectively public domain) this is your only choice. You CANNOT use ANY pre-existing Doom, Heretic, Hexen, or Strife code at all. Thus your code would have to be written from scratch.

Gustavo6046 said:

A source port built in Python. It would be harder to code, but it could be based in any good source port and it would support any IWAD. Also it could load Python bots (but I don't know how to import from pointers in Python).


If you change your license to GPLv2+ or GPLv3+ you can port the original source code release. This would be easier because you have an existing code base to work with, however you would have to know C and such to know what the original code is doing.

With the wider selection of source ports available, it is recommended to choose either GPLv2+ or GPLv3+ than to use the Doom Source License.

Gustavo6046 said:

Any suggestions to make this better?


I would first recommend using an existing source port such as Chocolate Doom and then modifying it some bits to get the hang of how the original source code is laid out and what everything does. Modify a bunch of stuff breaking compatibility to learn how the engine works without breaking things. Make say a Cyberdemon which spews out kittens that attack the player if in range (and if not, they circle the Cyberdemon), then when the player kills the kittens to defend self put "WTF Hero!" on the screen. Do this in C!

Gustavo6046 said:

I need to have this done, my deadline is February 1st, 2020. Anyone want to join this team and provide contributions to the code?


Deadlines are meant to be broken, Although 2020 is 4 years from now, such a task can take quite some time depending on your availabilty. If you currently do not have a job and you do get one, expect your task to take longer.

Gustavo6046 said:

PyDoom


Appears for PyDoom that Kate decided on a pure reimplementation rather than base off existing code (at least for now). There is no game logic that I can find thus I believe that PyDoom is incomplete. I am not sure that she still works on it since the last commit was earlier this year, but I myself have taken long breaks and it has been 6 years (going on 7) since I last released ReMooD (if it were a WAD I would get a Mordeth award). So you would best ask her.

Share this post


Link to post
GhostlyDeath said:

Seeing that your repository license is CC0 1.0 Universal (effectively public domain) this is your only choice. You CANNOT use ANY pre-existing Doom, Heretic, Hexen, or Strife code at all. Thus your code would have to be written from scratch.

You continue to demonstrate a universally poor understanding of copyright and licensing issues. CC0 code is public domain, which means you can in fact create derivative works of it and subject them to whatever copyright you want, including one based on the GPLv2 or GPLv3. The only burden on you if using someone else's public domain work is to prove you added something sufficiently original and creative that can be subjected to copyright.

Just like you can copyright a photograph of the Mona Lisa if you put your own frame around it and simulate the effects of disco dance lights illuminating it, but (in the US at least) you cannot own copyright on JUST a perfectly cropped image of the Mona Lisa.

Share this post


Link to post
Quasar said:

You continue to demonstrate a universally poor understanding of copyright and licensing issues. CC0 code is public domain, which means you can in fact create derivative works of it and subject them to whatever copyright you want, including one based on the GPLv2 or GPLv3. The only burden on you if using someone else's public domain work is to prove you added something sufficiently original and creative that can be subjected to copyright.


No. If he includes any Doom, Heretic, and Hexen code into his CC0 1.0 then it is no longer fully CC0 1.0 because of the DSL/GPL bits in there, do you contest this? He can use that code, however it will just be a partially dual licensed work. His code would be under the CC0 1.0 however but a large portion would just be DSL/GPL licensed. Thus effectively as a whole project if he chooses the GPL license, the effective project would be GPL licensed.

Also CC0 1.0 is not public domain, I said effectively it is public domain. The purpose of the license is to be that because some countries do not even have a public domain or they have a public domain which is entirely different from the US version. Thus in countries which lack a public domain, the code just ends up getting default copyright status which makes it unuseable. CC0 1.0 is a license with defined terms unlike a bland statement saying "This is in the public domain". Also saying something such as "This is in the public domain in the US" can be defined to mean that only in the US is it public domain and not any other country.

Share this post


Link to post

If so then is there some easier way of making bots? I can't compile anything right now, MinGW is fucked, etc.

Share this post


Link to post

Gustavo: You need to show up with code before presenting ideas like this. It's not really the first time you've posted things without subtance. People don't generally rush in to do all the work for you.

Even preliminary WAD reading code would go a long way to show dedication.

Share this post


Link to post
chungy said:

Gustavo: You need to show up with code before presenting ideas like this. It's not really the first time you've posted things without subtance. People don't generally rush in to do all the work for you.

Even preliminary WAD reading code would go a long way to show dedication.

If at least you ever saw the code in GitHub... It's not id Tech 1. I already made the code which will be the basis for any future code...

Share this post


Link to post

What you've written isn't any more complex than "Hello World!", and only shows you understand how to follow a syntax and create primitive structures. Not a full blown recreation of a 2.5D engine with input, physics, AI and rendering.

Share this post


Link to post

I don't understand this Gustavo guy...why doesn't he just use the existing PyDoom source and move forward from there? At least this way, since you seem unwilling to learn how the engine works with C/C++, you can get an idea through that port. And since it seems ready to go (?), you can work on making small hacks from there. Drop your bombastic attitude because it's getting really tiring, but I don't mean to insult you either because enthusiasm is a good thing! Being energetic is good, but observations of your behavior tend to point to the fact that you are unmotivated to dive into the trenches.

Drop your bot fantasy (because if it was worth it, it'd already have been done better...but looks like it's getting another go), and all of the other grand Unreal/etc "ideas" and just stick with compiling it. Hack little things and work your way up. I'm not sure how pure of a port PyDoom is, but it's a freaking start! Do you have any idea on how the original engine works? If not, lock yourself in a room for 6 months, use the wiki and every other source port code and start comparing and taking notes. That's what I had to do, and it took me a lot longer than 6 months at that. But dedication goes a long way. =)


I dunno, is it just me or does Python not seem intuitive for Doom's source? What's up with the whitespace rules or whatever? Why is it so...different...

Gustavo6046 said:

If so then is there some easier way of making bots? I can't compile anything right now, MinGW is fucked, etc.


And, um, what's up with that? You haven't even compiled the original source into an executable yet? Using Windows? What package are you attempting to put together? I used to use MinGW for Win32 (switched to Cygwin) so maybe I can try and lend a helping hand!

Share this post


Link to post
Chu said:

I don't understand this Gustavo guy...why doesn't he just use the existing PyDoom source and move forward from there? At least this way, since you seem unwilling to learn how the engine works with C/C++, you can get an idea through that port. And since it seems ready to go (?), you can work on making small hacks from there.


From looking at the source code of what exists in PyDoom (unless there is an external module I do not know about) it is not currently yet a Doom source port as it cannot play Doom.

Seeing that Gustavo lacks experience with general programming and Doom in particular, this would be a large wall in his way of a Python port.

He would also have to know about all the undefined and implementation specific behavior that is C.

Chu said:

Drop your bot fantasy (because if it was worth it, it'd already have been done better...but looks like it's getting another go), and all of the other grand Unreal/etc "ideas" and just stick with compiling it. Hack little things and work your way up. I'm not sure how pure of a port PyDoom is, but it's a freaking start! Do you have any idea on how the original engine works? If not, lock yourself in a room for 6 months, use the wiki and every other source port code and start comparing and taking notes. That's what I had to do, and it took me a lot longer than 6 months at that. But dedication goes a long way. =)


One thing he must learn from this is that he will never make the port he wants until he starts trying to.

Dreams are not real until they are made real.

Chu said:

I dunno, is it just me or does Python not seem intuitive for Doom's source? What's up with the whitespace rules or whatever? Why is it so...different...


The end of all whitespace wars.

Share this post


Link to post

I started to work on it but lost interest in it, and was intending to pick it back up recently but my hard drive died and I lost all of my projects and work.

The plan was to make some modules to piece together a framework for a 2.5D engine, since I was going to use it for my own projects. As such, it wouldn't purely be a source port since it won't play Doom on its' own (and certainly not accurately, since it wouldn't be able to emulate all of the bugs and quirks that vanilla Doom has, not being pure C, nor would I ever be remotely interested in trying to emulate anything beyond the most used/basic behavior since my own projects have different requirements), but instead supply components that would be needed to create an engine that can do so given a script that imports the components, initializes them, and supplies the basic game loop logic.

I do not know when or if I'll be picking it back up. I might, but right now I have more important things to sort out.

Share this post


Link to post

I can continue working in your project Kate! I am a very good Python coder, and I'm trying to do a video-to-frame extractor to use the frames in my WADs with ANIMDEFS to make short video clips easier than TRUCK.WAD (but I made more useful stuff!).

Well, another piece of code I can show is the GUI projects I have for command-line interfaces like DoomSND.

I can fork your project and work some hacks in it?

Share this post


Link to post
Chu said:

I dunno, is it just me or does Python not seem intuitive for Doom's source? What's up with the whitespace rules or whatever? Why is it so...different...

Lots of people who have been using curly brace languages for a long time have this hesitation when learning about Python for this reason. It's a great language. You should learn it.

Share this post


Link to post

Well, there's a version of Doom written in a non-curly language: DelphiDoom, though one could argue that its begin/end blocks are nothing but brackets in disguise, and the approach of the language itself is quite low-level and close to C to begin with, so it would not really be a good starting point for a pure Python port.

Not trying to pitch myself here, but something like Mocha Doom which has already worked out the struct -> object oriented and unsafe -> safe transition would be a more solid base.

Share this post


Link to post

He meant free-form syntax, you don't have to get so pedantic. Whitespace is still syntactically irrelevant in Pascal.

Python uses whitespace (indentation level, to be specific) for defining when blocks start and end. It's largely the same style as any competently-written C program will be written as, and it avoids people glossing over code with the appearance of belonging to a block it actually doesn't. Indentation in C is purely cosmetic for the benefit of programmers. Indentation in Python is enforced by the language to actually mean what it looks like.

Share this post


Link to post

So I've forked PyDoom in GitHub... and added some changes. I am trying to put hacks in it, more specifically useful hacks, but I can't seem to do much what is in the TODO.TXT Kate put in it... I just added a system that enables key bindings in the configuration script, but I need it to enable saving bindings into a file.
Thanks Kate for providing this solid support for my project!

Share this post


Link to post

By the way, I demand you change or remove the copyrights for these files as they are misappropriated and I refuse to have my name on any code that I did not directly write or modify myself without explicitly granted permission, as per the third license condition. They are not part of PyDoom, and therefore not officially copyrighted to me in any way. Thank you.

Share this post


Link to post

Personally I'd start with a working Doom engine and then embed the python interpreter (see e.g. Extending and Embedding the Python Interpreter) and then you only need to worry about bridging C and Python at the area you want to work in, rather than worry about moving the whole game engine over.

I did this once: I thought it would be interesting to port Doom to Python piecemeal, by starting with an embedded interpreter then gradually moving more and more of the code over. I never got beyond embedding the interpreter, but I was impressed how easy that was.

Another language that is apparently very easy to embed is Lua.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×