Rewriting the game engine. (Plz read developers ect.)

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Nexuiz better in c or c++

C++ ftw
3
16%
C <- its cooler :)
9
47%
Wtf is c++
7
37%
 
Total votes : 19


  • OK.. I am going to make a proposal and if i fail at it i fail at it.
    I have a decent knoledge of c++ and many people in my family use c++

    My original idea was to add things that players liked to nexuiz.

    Unfortunatly the code is written in c.
    I am fluent in c. but i belive it would be more helpful to Nexuiz if it was written in c++.


    So. I offer to rewrite the entire thing (with the exception of a few thinings that just shouldn't)
    in c++.

    Now im not saying it will be done quickly but i think i can have some of it done before 2010 starts.

    Now alot of you probaly think that i wont even do this and that im just some noob that thinks hes the worlds greates programer. well your thinking wrong... because i know im not the best but I still can do it.

    Im doing more to test my skill, to discover how much it will take before i break.

    The reason im writing this is to get your oppinions on nexuiz and things you would like to see there...

    So far we had some ideas from other players:
    Clan system
    Stat system
    Body system<- not sure about that

    ==============================
    I would like to have more and more ideas so i can tell what you guys would like to see in nexuiz.


    This will be the format for posting.
    The person will post a post:
    Jimmy:

    Better Bots

    Then the person under him will either agree or not agree and/or add his own
    they do this by copying the person above them! Make sure to add an X if you support the idea

    Bob:

    Better bots x
    Clan System

    Robert:

    Better bots xx
    clan system



    Thank you in return.
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Sat Feb 21, 2009 4:10 pm

  • The game engine is written in C, but most of the stuff you mentioned is actually in quakeC, which is much easier to work with then C. Plus, rewriting it in C++ would mean it would be less efficient.
    User avatar
    Psychcf
    Forum addon
     
    Posts: 1554
    Joined: Sun Dec 03, 2006 11:38 pm
    Location: NY, USA

Sat Feb 21, 2009 4:11 pm

  • Well is it possible to efficiently mix c++ with quakeC?
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Sat Feb 21, 2009 5:22 pm

Sat Feb 21, 2009 7:05 pm

  • Use search next time, there just was a discusion about that topic
    bye sYm PB

    #pb.nexuiz #nexuiz.de @ quakenet.org
    User avatar
    sYm
    Advanced member
     
    Posts: 59
    Joined: Sat Dec 30, 2006 4:27 pm

Sat Feb 21, 2009 8:04 pm

Sat Feb 21, 2009 8:43 pm

  • I don't understand the reasons. Do you lack OO capabilities in engine? What's wrong with procedural code?
    Alien
    Forum addon
     
    Posts: 1212
    Joined: Tue Apr 22, 2008 7:12 am

Sat Feb 21, 2009 8:57 pm

  • @sym :: plz dont act smart... i am posting this because I am working on it (or might be) so searching it wouldnt have helped me much

    @GreEn'mArine c++ is a programming language that is easier to read than c++ (kinda) and is a branch of c programming

    @chubby it dosent help me much knowing your oppinion on the engine but thanks anyways

    @Alien OO? and i dont like the engine because its written in all c I belive it would be alot easier for people to help nexuiz if its written in c++ being as c++ is easier to learn and it has some functions c dosent.

    @all no one answered my question .... would the engine mix well if it used c andd c++?
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Sat Feb 21, 2009 9:28 pm

  • It seems you don't know how C and C++ differs and why C++ is called C ++ (boosted C or C with classes).
    Alien
    Forum addon
     
    Posts: 1212
    Joined: Tue Apr 22, 2008 7:12 am

Sat Feb 21, 2009 11:30 pm

  • well i was once studying c.... but then i gave up on it after fidning most games were programed in c++ and i loved the overal feel of c++

    but no .... i didnt know the biggest differences

    but plz answer my question so i know what i should do

    would the game run properly if it was c and c++ mixed?
    string response;
    cout<< "Yes or No?";
    cin>> response;


    :) :) :) answer plz
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Sun Feb 22, 2009 1:38 am

  • Well you should know that C++ isn't more powerful than C, nor the other way round. You can achieve exactly the same goals with both languages, or assembler, or Java, or C#, or whatever. Of course not always using the same hardware :)
    Before wasting time choosing a programming language you should think about what you really want to do.

    would the game run properly if it was c and c++ mixed?

    What makes you think that the game isn't running properly?

    Maybe you noticed that Nexuiz is currently developed in Quake C. Probably you are confusing a little game and engine. And you should know there are other Quake C interpreters (like Darkplaces) written in other languages.
    I suggest to you making a little more research before going to waste entire years reinventing the wheel ;)
    User avatar
    mand1nga
    Alien trapper
     
    Posts: 321
    Joined: Mon May 12, 2008 12:19 am

Sun Feb 22, 2009 2:21 am

  • well, dont talk about Assembler - that's a whole different class of things.
    fronten
    Advanced member
     
    Posts: 96
    Joined: Thu Apr 20, 2006 9:52 pm

Sun Feb 22, 2009 3:53 am

  • here's my 5.

    Nexuiz is not c, not c+, not cobol etc. nexuiz is gamecode and art/assets. gamecode is currently in quakec.

    imo converting something from x to y serve no purpose unless there's something you wish to do that cant be done or you cant do in the current form.

    if your going to do it anyway, just do it or at last have something to show for. this endless discussion of b"ananas are better then apples!" are getting so old.
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Sun Feb 22, 2009 6:08 am

  • Insanity.
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Sun Feb 22, 2009 1:36 pm

Sun Feb 22, 2009 3:02 pm

  • Hello everybody.

    Honestly, I think that OO code is much better than procedural, but it's bad to waste a time to rewriting whole engine (and how much time you will spend to debugging result code) - and there must be giant list of "vacancies" in engine's programming (but I voted for C++).
    Nexuiz?... Well done!
    User avatar
    Slav
    Newbie
     
    Posts: 5
    Joined: Sun Feb 22, 2009 2:42 pm
    Location: Russia - Togliatti

Sun Feb 22, 2009 8:11 pm

  • forget rewriting it....


    im not saying nexuiz dosent work properly

    im asking will it work properly if i include c++ code....
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Sun Feb 22, 2009 10:21 pm

  • Most often yes. http://en.wikipedia.org/wiki/Compatibil ... nd_C%2B%2B

    A lot of things will depend on the compiler and how it allows to mix possibly incompatible c/c++ code (e.g. you can compile darkplaces c code using ms visualc++ (which is notorious for not following standards), but that does not mean that you could compile same code using g++ or intel compiler).

    My suggestion is to try to compile and check if it works (most often it would).
    Alien
    Forum addon
     
    Posts: 1212
    Joined: Tue Apr 22, 2008 7:12 am

Sun Feb 22, 2009 11:20 pm

  • thank you .... i will try
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Mon Feb 23, 2009 6:52 am

  • I tried to compile Nexuiz with g++ (MinGW) - it did NOT worked :(
    But already compiled .o-files (with gcc) could be linked properly with g++.
    So it's possibly to compile .c-files with gcc, c++ with g++ and then link it - that's how I will do.
    Last edited by Slav on Mon Feb 23, 2009 7:14 am, edited 1 time in total.
    Nexuiz?... Well done!
    User avatar
    Slav
    Newbie
     
    Posts: 5
    Joined: Sun Feb 22, 2009 2:42 pm
    Location: Russia - Togliatti

Mon Feb 23, 2009 7:14 am

  • Actually, DP is supposed to compile with g++ without any changes, but this sometimes breaks (and then gets fixed later).
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Mon Feb 23, 2009 10:07 am

  • Porting the engine to C++ is not necessary as it already compiles with g++ (at least the current development version does.. maybe the engine in 2.4.2 did not, but it is checked and fixed now and then as divVerent mentions)

    Porting the code to be OO will require LOTS of work and i'm yet to see software were this REALLY helped to make the code easier to understand. Generally people just talk about OO as the holy grail but only a frightening small number of people REALLY uses it correctly. As long as you are not proposing a good design idea i guess code quality will just suffer, more bugs will be introduced and this 'port' will not improve anything at all.

    You can mix C and C++ code, its often done but for DP i do not see what you would gain by doing so. Beside making it even harder to understand as you have to understand both C and C++.


    Besides stuff like BOTs and their AI is not coded in C at all. Only the ENGINE is coded in C.. the engine in turn is interpreting 'byte-compiled" QuakeC which makes up the GAMECODE. This gamecode is what makes Nexuiz do what you know as the game Nexuiz. The engine is very general purpose and in fact its a Quake 1 (!!) engine that can run all sort of quake1 games, mods and if you like 'über-mods' that make up dedicated games like Nexuiz or Darsana.
    QuakeC how ever is very similar to C with some special things tailored to games. If you want to change THIS part you would need to change the engine so that it understands what ever 'new' language you want. Its possible but hard and again i see nothing to 'win' from doing so.
    User avatar
    esteel
    Site admin and forum addon
     
    Posts: 3924
    Joined: Wed Mar 01, 2006 8:27 am

Mon Feb 23, 2009 8:38 pm

  • i see what you mean... thanks for the help...
    tehbomb
    Member
     
    Posts: 10
    Joined: Mon Feb 09, 2009 12:48 am

Mon Feb 23, 2009 10:36 pm

  • Slav wrote:I tried to compile Nexuiz with g++ (MinGW) - it did NOT worked :(
    But already compiled .o-files (with gcc) could be linked properly with g++.
    So it's possibly to compile .c-files with gcc, c++ with g++ and then link it - that's how I will do.


    This won't always work.


    In the other hand, QuakeC could be made as a general purpose game programming language suited for fps games (dropping all those quake-only functions, effect names, etc..). But this is not related to C/C++ issue.

    I think if OP codes smth worthy in C++, I doubt div or lh will reject that. But who knows.
    Alien
    Forum addon
     
    Posts: 1212
    Joined: Tue Apr 22, 2008 7:12 am

Tue Feb 24, 2009 9:38 am

  • Well, if we consider that the number of C++ developers are way far much more, than the number of people who know QuakeC, Im for this idea, since it would attract tons of programmers into this game. I also think that C++ is easier to read, but maybe its just me :P Good luck for the debugging process lol :D
    Image
    User avatar
    FraNcoTirAdoR
    Alien trapper
     
    Posts: 288
    Joined: Tue Mar 04, 2008 10:25 am
    Location: near the nex

Tue Feb 24, 2009 9:49 am

  • The problem is NOT QuakeC .. its similar enough to C and if you show me a coder that says he knows C++ but NOT C i'll personally slap him with my cluebat!!!
    The problem is the domain specific knowledge you need to have regardless of the used language. You need to understand how the system works.
    User avatar
    esteel
    Site admin and forum addon
     
    Posts: 3924
    Joined: Wed Mar 01, 2006 8:27 am



Return to Nexuiz - Development




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest