Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / The Programming Competition

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Aug 2014 14:51 Edited at: 29th Aug 2014 03:33
I want to extract the programming discussions we had going on in The Posting Competition and have them continue in this thread, as there was a lot of knowledge and neat information being posted from time to time.

This thread is dedicated to everything revolving around non-TGC programming languages. Ask for help from other members here, post updates and screenshots of your latest projects, whatever it may be. Lets motivate each other.

Main Topics of Discussion

* Programming languages such as C++, Python, Java, Lua, C#, or whatever you may be using.
* Shaders such as HLSL, GLSL, or Cg
* Build Systems such as CMake, libtool, or premake.
* Version Control such as git.
* Command Line Stuff such as bash, batch, or configuring a Linux Kernel.

Rules

* Every post you make should in some way give feedback on the previous post.
* If you're asking for collaborative help on your project, use version control to coordinate it. I recommend getting git and pushing to github.com.

Active Projects

* FPS by Indicium (C++/Ogre3D/SDL): https://github.com/karljacques/Teabag

You can request your project to be listed here in the master post. It must be a link to a version control host (such as github.com).

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Aug 2014 16:58 Edited at: 27th Aug 2014 16:59
To start things off, here's a thing I'm slowly progressing on.

As you all know, getting cross-platform C++ code to actually compile on all platforms is an absolute nightmare. Of all of the build systems, CMake is the most powerful one, but learning how to properly write cmake scripts can be more painful than maintaining 3 individual makefiles for the total newb.

I've taken the time to learn how to properly write cmake scripts, but it still takes a while to set everything up when starting a new project, and even more time when you want to port an existing project to use cmake.

I've started working on a tool to address this problem. I call it AutoCMake:



It's a graphical front-end to CMake that will let you easily configure how your projects compile, what your dependencies are, etc. It will then spit out CMake scripts and automatically build your project for you.

I'm writing it in Python and am using Qt4.

R.I.P.

Attachments

Login to view attachments
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 27th Aug 2014 17:03 Edited at: 27th Aug 2014 17:05
*pirate accent* A very good idea, this be!

Well, on its face it's a good idea, but it may need some tweaking. For example, despite the name there's no actual competition-related information: Scoring, rules, etc. Ok, so there's rules, but no consequences if they're broken (as in loss of points etc.).

Other than that, however, it's a good idea. I'd comment more and even kick-start the thread except that I really need to be in bed right now. I'm sick, tired and probably need to be up at 8 tomorrow to drive my sister to the doctor.

EDIT

Quote: "It's a graphical front-end to CMake that will let you easily configure how your projects compile, what your dependencies are, etc. It will then spit out CMake scripts and automatically build your project for you."


What? Is there not already a GUI for Linux?

Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 27th Aug 2014 21:04
CMake is the build system, you still need to generate the CMake scripts. TheComet is making a GUI to make the scripts that the CMake GUI can use to generate the build files.

I.e. AutoCMake -> CMake build scripts -> CMake -> Platform specific make files / Project files

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 28th Aug 2014 06:56
Quote: "CMake is the build system, you still need to generate the CMake scripts."


I know. I misunderstood, though. I thought TheComet was making a GUI to run the build scripts, like in Windows, where you can modify variables easily and autofill stuff. I now see he's making a GUI to create the scripts in the first place.

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 28th Aug 2014 23:40
This could certainly prove to be a useful thread. I'm starting up a project using wiimotes to pinpoint real world 3D coordinates with the principles shown here. The plan is to instead use 2 wiimotes instead of 2 infrared lights for a more accurate reading as discussed here. Hopefully I don't run into any major design flaws along the way

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th Aug 2014 03:00
I think I'll take this opportunity to share the little project I'm working on right now. I intend it to be a cross platform first person shooter. Nothing flash, some multiplayer TDM and not much more than that. TheComet has been a fantastic help in making sure it runs on Linux as well as Windows, so thanks for that again. The engine is built mostly around the component pattern, it uses the observer pattern to send messages between components, so I am theoretically able to plug any mix of components into an entity to construct its behaviour. In reality, I've added solid dependencies of some components to others, for example I've made the physics component dependent on a positional component. It's written in C++, uses Ogre for rendering, SDL for window creation and input, Bullet for physics and will use RakNet for networking.

https://github.com/karljacques/Teabag
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Aug 2014 03:38 Edited at: 29th Aug 2014 03:38
@Indicium
I added it to the first post. It might be a good idea to add a README.md containing at least a list of dependencies to your project.

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th Aug 2014 03:39
Quote: " It might be a good idea to add a README.md containing at least a list of dependencies to your project."


Yes, right after I polish off this pasta!
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 29th Aug 2014 04:42
Quote: "I'm starting up a project using wiimotes to pinpoint real world 3D coordinates with the principles shown here."


Ooh, that sounds cool, I like projects like that!

Quote: "The engine is built mostly around the component pattern, it uses the observer pattern to send messages between components, so I am theoretically able to plug any mix of components into an entity to construct its behaviour. In reality, I've added solid dependencies of some components to others, for example I've made the physics component dependent on a positional component."


I wish I had the skills and know-how to build a system like that. In general my programming tends to build inextricable links between various parts, despite my efforts to the contrary.

Quote: "README.md"


What is .md? It's another format that's frequently used in source code repos (like makefiles) that isn't recognised by Windows.

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th Aug 2014 04:50
Quote: "
I wish I had the skills and know-how to build a system like that. In general my programming tends to build inextricable links between various parts, despite my efforts to the contrary."


I don't consider myself to have much in the way of skill. http://gameprogrammingpatterns.com/ is definitely a fantastic place to start, it's where I've learned the most about design patterns rather than just lumping everything together. If you're using C++, or a similar language, it's easy to stop yourself from creating links to other areas of code by simply not including the file which would create links between components. I find by refusing to include it, I force myself to think about the design.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Aug 2014 04:54 Edited at: 29th Aug 2014 04:56
Quote: "What is .md?"


Markdown

Wikis and other text based files are usually written using it. It's plain text, just open it with notepad.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 29th Aug 2014 16:59 Edited at: 29th Aug 2014 17:00
Quote: "It's plain text, just open it with notepad."


Oh I realise that, but it's hard to read because it's like opening an HTML file (ok, so it's a bit easier to read than a raw HTML file, but still...).

Is it something that Linux natively supports?

EDIT:

Quote: "http://gameprogrammingpatterns.com/ is definitely a fantastic place to start"


Wow, that's an amazing resource! Perfect, thank you!

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Aug 2014 18:38
Quote: "Oh I realise that, but it's hard to read because it's like opening an HTML file (ok, so it's a bit easier to read than a raw HTML file, but still...).

Is it something that Linux natively supports?"


It's not really that hard to read:


Linux doesn't support it natively, no, but github does. Here's what the above text looks like on github:
https://github.com/TheComet93/chocobun/blob/master/README.md

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th Aug 2014 23:22
I absolutely love the component pattern; I created a control component to control a camera which literally just handles input and sets some physics options, then you plug it into an entity which has a physics component, camera component, position component and it just works! Oh okay it also applies the force to the physics body but it is a controller so that's to be expected.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Aug 2014 22:25
What level are you looking for here? I am just starting to learn bash and elisp, I could post some interesting things I come across but they would be at the beginner level.

Formerly OBese87.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 31st Aug 2014 01:09
Any level! After all, the TGC motto is "A noob's wish is a pro's command"

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 31st Aug 2014 06:10
Quote: "It's not really that hard to read:"


Ok, so it's not actually hard to read, but it's messy.

Back on topic, I've created a Mercurial repo for my old Bullet Physics wrapper, in case people want to work from it. It's not finished, but it works and most of the basic physics features are there. https://bitbucket.org/Clonkex/bullet-wrapper-for-dbpro

BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 2nd Sep 2014 03:05 Edited at: 2nd Sep 2014 03:12
Java baseball. Going to sell this to EA sports for 1 billion currencies.



Quote: "Back on topic, I've created a Mercurial repo for my old Bullet Physics wrapper, in case people want to work from it. It's not finished, but it works and most of the basic physics features are there. https://bitbucket.org/Clonkex/bullet-wrapper-for-dbpro"


I never fully got into C++, I'm holding out for jetbrains to release their C++ IDE for windows, I find VS a bit too bloated and lighter editors don't have the feature set of full intellisense etc. Sublime is good though.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 4th Sep 2014 01:59 Edited at: 4th Sep 2014 02:04
Sorry, I have to break rule one as I don't know enough java to comment. Looks like a joke using keywords but... ???

Can I post this in here:


The first of twenty lectures on the Structure and Interpretation of Computer Programs. I only found them a few days ago but they are from 1986, so they are using an old version of lisp but the content is still as relevant as ever. Great explanations of programming paradigms. I think anyone who watches these will instantly write better code in whatever language.

Formerly OBese87.
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 4th Sep 2014 03:27
Quote: "Can I post this in here:"


I haven't watched the video, but I'd say this is ok

Quote: "they are from 1986"


And you can tell instantly just by looking at the YouTube preview That hair...

Yodaman Jer
User Banned
Posted: 5th Sep 2014 19:15
I am currently working on a new iteration of my game I was making with Unity back in the start of the year. I haven't gotten too far but I do have a lot of the basic elements working.

Here's a video showcasing my use of the physics engine to create hovering objects:




Meh game development blaugh!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Sep 2014 00:40
Looks good!

Hmm, DBP runs inside my VM. I'm going to do an experiment and pick up an old project again:



The code's a mess and it's going to take a while for me to get back into DBP, but I really want to finish this game.

I like offending people. People who get offended should be offended. -- Linux Torvalds
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 6th Sep 2014 15:34
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Sep 2014 04:35
If anyone would like to join our C++ skype group where we help each other with stuff, add me (skype name: the__comet) and I'll add you.

I like offending people. People who get offended should be offended. -- Linux Torvalds
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 7th Sep 2014 04:41
Message sent.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 7th Sep 2014 07:26
I rarely use Skype, and I don't really have time for it, but thanks for the invitation anyway

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Sep 2014 18:49


I like offending people. People who get offended should be offended. -- Linux Torvalds
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 11th Sep 2014 18:54
yes! it's like a git cheat sheet. that will be handy. TheComet I've noticed you use references a lot - and I never use then. am I doing something wrong? should I be using them? eg in the example you give in the other thread you return &Person not *Person like I would.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Sep 2014 20:42 Edited at: 11th Sep 2014 20:46
There is no performance difference between pointers and references. References are just pointers in disguise. The only difference is that pointers allow nullptr as return types, whereas there is no such thing as a "nullref".

My rule of thumb is: If a nullptr is absolutely required, or if you need to do pointer arithmetic, use pointers. In any other case use references.

References are probably more idiomatic in C++. They are more tightly bound, there are no extra steps involved in getting the value, and they force the programmer to always have initialised values (unlike with pointers). This is compiler enforced.

With function arguments, passing by const reference should always be used over passing by value, unless the passed value is a POD.

Const reference:


Lastly, there's my aesthetic view on references. I think my code looks better like this:


Than this:


I like offending people. People who get offended should be offended. -- Linux Torvalds
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Sep 2014 03:16
Finished my entity component framework. If you're a C++ programmer and are having trouble structuring your code properly, this may be just the thing you need!

https://github.com/TheComet93/ontology

I like offending people. People who get offended should be offended. -- Linux Torvalds
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 12th Sep 2014 05:04
Huh, interesting concept (that of ref vs ptr I mean)... I've clearly completely misunderstood what a reference is (which is probably why I was confused by a lot of other people's code).

*googles extensively*

OH. I see... wow, references are really cool. How did I not learn this when I first learned C++? AND I finally understand what const is for. *facedesk* I really know nothing about C++, don't I?

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 12th Sep 2014 12:28
Quote: "OH. I see... wow, references are really cool. How did I not learn this when I first learned C++? AND I finally understand what const is for. *facedesk* I really know nothing about C++, don't I?"


I'm feeling the same way, I blindly stumble my way through programming.
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 12th Sep 2014 17:05
Quote: " OH. I see... wow, references are really cool. How did I not learn this when I first learned C++? AND I finally understand what const is for. *facedesk* I really know nothing about C++, don't I?"

More like you know just enough to be dangerous.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 13th Sep 2014 16:29
Quote: "I blindly stumble my way through programming."


Me through and through

Quote: "More like you know just enough to be dangerous."


Nah mate, I know more than that. I'm well versed in most of the concepts of programming (things like not using pointers directly if you can help it - that's just asking for trouble), but the more specific syntax and intricacies of C++ still escape me sometimes.

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 9th Oct 2014 15:14
I've implemented networking! Now I have the horrid task of keeping client and host synchronised ahead of me.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Oct 2014 15:38
What synchronisation model are you going for?

I like offending people. People who get offended should be offended. -- Linus Torvalds
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 9th Oct 2014 16:04
http://gafferongames.com/game-physics/networked-physics/

The method described here, under client-side prediction.
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 10th Oct 2014 14:27
Quote: "http://gafferongames.com/game-physics/networked-physics/"


Very useful article, thanks! Bookmarked

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Oct 2014 16:59
Quote: "Finished my entity component framework. If you're a C++ programmer and are having trouble structuring your code properly, this may be just the thing you need!"


This is great, hope I find time to try it out at some point. After working with UE4 and Unity you get into the component way of doing things and I would like to bring that to my AppGameKit C++ framework. Great resource, thanks for sharing

Login to post a reply

Server time is: 2024-03-29 15:29:38
Your offset time is: 2024-03-29 15:29:38