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

How do you learn how to build source ports?

Recommended Posts

What fascinates me the most about this community is the source ports that where contributed here, manly the hardware accelerated ones like gzdoom and doomsday are the ones that shocked me the most just seeing how amazing they look.

I wanted to know how and where to start leaning how to build a source port on my own.
Say I wanted to build one using vulkan for example.

Not asking for anyone to magically turn me into a coding king on this thread. I just need help with the first step.

Share this post


Link to post

^^ yeah real helpful.

Wanting to make a port using an entirely new API is probably out of the question, especially if you don't have a strong foundation in programming to begin with.

I would suggest using a guide like https://www.doomworld.com/vb/source-ports/73613-compiling-chocolate-doom-with-visual-studio-a-simple-ish-guide/ (ahem) to compile your own copy of a source port, and then start looking around the code and making your own changes to it to get a feel for how it works.

Share this post


Link to post

Is that used in just about every source port here? I do know VERY basic about c++ and I used zdooms acs scripts before.

For a compiler, I dont know whats recommended. I used Dev C++ when I was leaning the basics.

Do graphics api's use something completely different?

edit: I may just start using openGL for now until vulkan is more familiar to every one.

Share this post


Link to post

*Linguica: Im setting up everything your guide has told me. Now I have that something to help me get started. Thank you.

Should I wait on Hardware APIs for now?

Share this post


Link to post

Programming is a skill that requires extensive knowledge and experience to master. As a beginner you might be able to make some simple changes to the source code but graphical effects are going to require years of experience to pull off. What you're proposing is migrating the entire rendering engine over to a new API - a massive refactoring work that requires experience you simply don't have.

None of this should be interpreted as a slight against your intelligence; I'm sure you're a very smart person but you can only become an effective programmer by writing lots of code, just like you can only become a good painter by painting a lot, you can only become a good guitar player by playing guitar a lot, and you can only become a good soccer player by kicking a ball a lot.

I also don't want to discourage you from hacking on the Doom source if it's something that interests you - it can be really fun. Just set yourself some more realistic goals and start off by just experimenting with things to see what you can do. You'll also want to buy yourself a book on programming to learn the basics.

Share this post


Link to post

I knew how tough it is to create new renderers and I still under estimated that hurdle badly.

I will start with poking around and prodding with stuff like learning how to build stuff from the source.

Very well said, I will take your suggestions and take it from there. Is zdooms acs also a good place for practice?

Share this post


Link to post
blueinferno776 said:

Is zdooms acs also a good place for practice?

ACS is good for learning the rudimentary basics of programming (variables, conditionals, functions, etc), but it's no substitute for actually learning to compile a working program.

Share this post


Link to post

There separate entities then. I thought it could gateway to the source stuff. I will look out for some useful programming books, would be my best bet.

Thanks for helping out! :)

Share this post


Link to post

Try Python the Hard Way -- it's not directly related to Doom programming, but serves as a good beginner's course to programming in general (and in a way that playing around with ACS won't really achieve). Don't be discouraged if it looks like a diversion from what you want, you'll learn some solid skills that will translate to almost any other programming language you use (there are exceptions -- some esoteric languages, some joke ones that are dumb on purpose, some totally different-mindset languages, but for C and C++, Python will have most of the same principles and trains of thought)

Share this post


Link to post

I remember python, looks interesting. I am going to try it out when I get the time to. I know a lot of linux stuff uses it for dependencys when I used to compile stuff on ubuntu. Not much though.

I still suck at compiling anything on windows for whatever reason. Tried to build chocolate doom with visual studio 2015 and got fatal errors all the time.

Learning this stuff is a real pain in the ass and its worth it.

Share this post


Link to post

I'd second the Python suggestion. I first sat down to learn to code and wanted to hack on doom myself, in around 1998. I started with C and it was a steep learning curve. I think with Python you'd make faster progress on learning to program.

Share this post


Link to post

Visual Studio is overly complicated and has subtle incompatibilities between different versions. A newcomer to programming would find it overwhelming and probably discouraging to continue. Start with the simple stuff first.

Share this post


Link to post

As an anecdote, from my own personal experience, what is now Crispy Doom today started as a simple patch against Chocolate Doom (it more or less still is today, but that's not the point). Back then I had only one goal: I wanted Chocolate Doom with doubled screen resolution. And thus I started working on it and fiddled and hacked until I finally succeeded. I was a painful experience, but I couldn't stop once I reached that point.

I wasn't completely new to C-programming at that time, I did some "Hello World" stuff before, but working on the engine with a clear goal in my mind really pushed my limits. I learned more about integer data types, bit shifting and masking and all this stuff and forcefully had to learn how to understand compiler warnings and errors. Until now I have implemented features in Crispy Doom that I thought I would never ever get to just one year earlier.

In the end all I can say is that I learned more by simply doing the things than by reading about them. Set yourself smaller, achievable goals and tackle them one by one. Learning how to code in order to replace Doom's renderer with a hardware-accelerated one may be a bit over the top for a start. ;)

Share this post


Link to post
chungy said:

Visual Studio is overly complicated and has subtle incompatibilities between different versions. A newcomer to programming would find it overwhelming and probably discouraging to continue. Start with the simple stuff first.



Its was not just me then, the few things I tried to compile on VS like fluidsynth was never a success story. I compiled and installed slade3 on ubuntu's terminal with no trouble. Your not kidding about VS being discouraging.

Fabian:Was hardware based ports a HUGE feat back in the day? It must of been murder to achieve for anyone who tried, Zennode GLBSP to get wads to run properly.

There is no really easy way into the programming is there?:) Leaning python the HARD way, I'm just going to be one stubborn bastard to make it though. I appreciate everyone here with all of the advice that's giving me some direction to where before I was WTF how do I even start something like this.

Share this post


Link to post
blueinferno776 said:

There is no really easy way into the programming is there?:)


Programming is easy. Doing what you want and doing it nice, efficient, and fast is the difficult part.

Also, it is much easier to get into programming today compared to when I got into programming 16 years ago.

When programming you must always strive for improving yourself. When programming you must accept that your code may be wrong, either in the algorithm, the result from debugging, lack of experience, etc.. What I mean by this is that you do not want to be delusional in that your code is always correct and never wrong, but not depressing that it is always wrong. Everything can be improved for the most part.

Also avoid premature optimization, which is to make code fast before it works. Make sure your code works before you make it fast, however do not be afraid to refactor and fix your code even if it is right but very ugly and horrible.

There are some good books which are available such as C Primer Plus (ISBN-13: 978-0321928429) which is for the C programming language. However, if your main development platform is Unix-like (UNIX, Linux, Solaris, BSD, Mac OS X) you will usually be using the terminal much so you might want to learn shell scripting, so you can read then read Unix Shell Programming (ISBN-13: 978-0672324901); this book teaches pure Bourne Shell which means it will work on every UNIX/POSIX system.

When buying books, you usually want to avoid eBook editions because sometimes they might lose all of the special formatting which results in a giant mess.

Share this post


Link to post

Sorry, but no, programming is not easy. It's a challenge and requires a lot of mental exercise. It can be extremely rewarding when you get software to work the way you want it to, but don't pretend it's easy -- in fact, this statement is probably dangerous to the OP, if he's stuck at some portion and has in his mind that it's supposed to be "easy" it can be demotivating. Don't do that. Programming is a difficult skill to master (at least on the order of a decade!), and like all skills there will be a lot of failure and trial of error before things click, and frankly, before you start becoming good at all. To the OP: don't give up!

C is directly relevant to hacking on source ports, but it is a terrible language for a newbie. He should get fundamentals of programming methodology down before venturing into memory management, safe string handling, word byte-orders, and other nasty details that Python hides away while C does not. I said it's a challenge, but it should be a fun challenge, and in the beginning stages, he needs to learn about variables, functions, and program flow without having to know all the pesky machine-level details that C exposes.

(Also, shell scripting is a useful skill but almost entirely irrelevant to C development anyway...)

Share this post


Link to post
blueinferno776 said:

Fabian:Was hardware based ports a HUGE feat back in the day? It must of been murder to achieve for anyone who tried, Zennode GLBSP to get wads to run properly.


Honestly, I have no idea. When I started hacking on the code, the OpelGL ports were already there.

Share this post


Link to post

Well really, programming varies in difficulty. On the easy end of things you have stuff such as Hello Worlds, basic games (Checkers, Minesweeper, side scroller shooter, etc.). On the hard scale of things you have stuff such as compilers, physics simulations, cryptography, cache-dependent tasks (along with LL, LS, SL, and SS), AI.

Learning by copying examples lowers the learning curve, whereas not learning by not copying examples increases it.

Hello World would be similar to ITYTD with IDKFA and saves.

When first learning algorithms and other such logical things, it could feel like you are playing Nightmare Scythe2. However once you get used to it, it is quite simple (but this varies from person to person).

It is also possible to learn faster by doing harder things sooner, depends on your brain and your ability to adapt and learn.

The most important facts required when programming are both logical and mathematical.

Trying many things out, such as writing different type of software from games to compilers can help increase your knowledge once you have enough of a steady base.

From personal experience, I have been programming since 1999 which is more than half of my life time. Some portions of my life I did not code that often, whereas others I would program every day (such as I do now) to the point where I would hallucinate (similar to Tetris) and think only about programming.

One thing to remember is to take breaks, go for a walk and see nature.

Share this post


Link to post
blueinferno776 said:

There is no really easy way into the programming is there?:) Leaning python the HARD way, I'm just going to be one stubborn bastard to make it though. I appreciate everyone here with all of the advice that's giving me some direction to where before I was WTF how do I even start something like this.

I used this analogy already in this thread but I'll repeat it again: programming is like any other artistic skill - drawing, painting, learning to play a musical instrument, etc. To become proficient requires time and dedication, though you can have plenty of fun along the way doing simpler things as you build up your skills.

Share this post


Link to post

Can I use UnrealScript or Python? My MinGW don't really work. I tried everything and I am out of ideas for MinGW.
- There could be a C++ to UnrealScipt converter, then I just work upon GZDoom source code and try to compile UScript to exe.
I would add .unr file compatibility for maps and .blend file compatibility for models.

Share this post


Link to post

What next? "Learn programming in 5 minutes with this weird trick"?!

Share this post


Link to post
Gustavo6046 said:

Can I use UnrealScript or Python?
- There could be a C++ to UnrealScipt converter

That's never going to happen.

Share this post


Link to post
fraggle said:

I used this analogy already in this thread but I'll repeat it again: programming is like any other artistic skill - drawing, painting, learning to play a musical instrument, etc.


Im going through stuff like #include iostream for hello world stuff, learning what commands mean where they need to be and how to end them. Like return 0 and lines that need semicolons at the end. Its making more sence the more I read it and type it.

I installed python on my windows 10 laptop and powershell of course does not reconize it. Even with the instuctions to fix that are not being reconized, I had a python.exe installed which opens up its own console. Dont know if thats a good substitute.

Visual nighmare is nothing short of bullshit, just opening a project file in gzdoom master gives me a laundry list of errors,compatibily problems. An epic waste of harddisk space.

I have a spare laptop I planned on using for linux stuff. It was still hard and I at least compiled stuff successfully on ubuntus bash console. It feels like windows is deliberately blocking me from any progress somehow.

I found a free android app called learn C++ that is awsome! The little I used it today really tries to simplify its lessons. It has videos that will really help visual learners. No micro tranactions either. :)

Share this post


Link to post
blueinferno776 said:

Visual nighmare is nothing short of bullshit, just opening a project file in gzdoom master gives me a laundry list of errors,compatibily problems. An epic waste of harddisk space.



Well, there's probably one important thing you missed:

GZDoom is a very complex project that requires a bit more work to get set up, than just copying it to your HD and press a button.

First, did you even CREATE a project with CMake? The project files inside the repo are just inherited from ZDoom and non-operational. There's also several dependencies you need to set up first before you can compile. If you do not do that, yes, you'll get a bootload of compile errors.

And did you even read the instructions?

Share this post


Link to post
Gustavo6046 said:

Can I use UnrealScript or Python?
- There could be a C++ to UnrealScipt converter, then I just work upon GZDoom source code and try to compile UScript to exe.


You could use UnrealScript, however:

  • You would have to write your own UnrealScript compiler or add a new front-end to GCC/LLVM which takes input UnrealScript and generates a native binary.
  • For a C++ to UnrealScript source translator, you would have to write your own C++ compiler (which is much more difficult than writing a C compiler) or add a new front-end to GCC/LLVM which can output UnrealScript. You could also compile the C++ code to MIPS for example and then write a MIPS decompiler to UnrealScript. Note that source to source compilers usually produce ugly code in the target language.
This of course assumes you have experience writing compilers.

If you want something similar to UnrealScript, use Java instead.

Share this post


Link to post

Technically, any C, C++, Python, Java and etc. compiler would work with some knowledge.

If you wish to try something COMPLETELY new, try to see about Blitz3D. It is pretty durable and easy to use.

Knowledge is power.

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
×