The Calandiel/David joint plan.

A forum for longer arguments surrounding how/if/to what extent an engine needs to be developed in order to facilitate the NGD project. This stuff might get quite technical at times, and I would ask to restrain from giving opinionated remarks and concise yourselves to more factual arguments for an ultimate decision to be made
User avatar
David Buunk
Posts: 75
Joined: Thu Jun 22, 2017 4:46 pm
Location: Netherlands

The Calandiel/David joint plan.

Post by David Buunk » Tue Aug 29, 2017 4:47 am

This is the plan that Calandiel and I came up with during some lengthy discussions. We hope that Demian weights in and approves it.

The code for SotE will be split in two parts, one dealing with the simulation, the other with the user interface. The simulation code will be written in C++, compiled into a dynamic library (for those used to the Windows term, a dll), and then loaded and used from the interface part. The user interface will be written in C# and Lua, and will be using Unity as game engine.

This has a number of advantages:
  1. C++ written code can run faster and with less memory overhead than C# code. The simulation code will be by far the most demanding on those things.
  2. The interface code will have all the benefits of C#. Think of such things as no dangling pointer bugs, and garbage collection preventing memory leaks.
  3. We can use Unity as game engine. Which means we have all the benefits thereof, without the drawbacks of having to work in C#.
  4. There is a clear, enforced, division between simulation and interface code. This will help keeping the code understandable, and bug-free.
  5. Development of the simulation code can take place on Linux, even though Unity doesn't support Linux as a platform for development.
  6. Calandiel can use his strengths in helping develop, as he's good in working with C# and Unity.
  7. I, too, can use my strengths in helping develop, as I'm good with C++.
Comments and questions greatly appreciated.
Programming SotE.

Demiansky
Posts: 48
Joined: Thu Jun 22, 2017 4:03 pm

Re: The Calandiel/David joint plan.

Post by Demiansky » Tue Aug 29, 2017 11:09 am

Sounds like a good long term objective, but a few questions: when did you think the best time to implement was? Also, what's the advantage of Linux? Never used it myself.

User avatar
David Buunk
Posts: 75
Joined: Thu Jun 22, 2017 4:46 pm
Location: Netherlands

Re: The Calandiel/David joint plan.

Post by David Buunk » Tue Aug 29, 2017 11:16 am

Demiansky wrote:
Tue Aug 29, 2017 11:09 am
Sounds like a good long term objective, but a few questions: when did you think the best time to implement was?
Last week.
Demiansky wrote:
Tue Aug 29, 2017 11:09 am
Also, what's the advantage of Linux? Never used it myself.
Too many to list here.
Programming SotE.

Demiansky
Posts: 48
Joined: Thu Jun 22, 2017 4:03 pm

Re: The Calandiel/David joint plan.

Post by Demiansky » Tue Aug 29, 2017 4:46 pm

Okay, so it sounds "ideal" but not necessarily initially practical for me, because it sounds like having to halt the learning process, learn Linux, learn C++, learn how to adapt it to Unity, and then dealing with anything else along the way that was unanticipated. I know you would like to go full steam ahead, but I'm still getting comfortable with some of the fundamental principles of CS and OOP.

User avatar
David Buunk
Posts: 75
Joined: Thu Jun 22, 2017 4:46 pm
Location: Netherlands

Re: The Calandiel/David joint plan.

Post by David Buunk » Wed Aug 30, 2017 3:11 am

Demiansky wrote:
Tue Aug 29, 2017 4:46 pm
learn Linux
Eh, no. This set-up is such that it makes development of simulation code possible on Linux, but not necessary. You can perfectly well keep using Windows.
Demiansky wrote:
Tue Aug 29, 2017 4:46 pm
learn C++
It's quite similar to C#.
Demiansky wrote:
Tue Aug 29, 2017 4:46 pm
learn how to adapt it to Unity
The entire set-up, and all adaptation-issues would be dealt with by Calandiel and me.
Programming SotE.

Demiansky
Posts: 48
Joined: Thu Jun 22, 2017 4:03 pm

Re: The Calandiel/David joint plan.

Post by Demiansky » Wed Aug 30, 2017 4:57 pm

Okay, so Linux possible rather than Linux mandatory. I'm wondering though how one uses C++ with Unity. I think I remembering reading that there was a pluggin or something to that effect, but also heard that there were a few confounding issues. Granted, I haven't done a heck of a lot of research on it.

User avatar
David Buunk
Posts: 75
Joined: Thu Jun 22, 2017 4:46 pm
Location: Netherlands

Re: The Calandiel/David joint plan.

Post by David Buunk » Wed Aug 30, 2017 5:03 pm

Demiansky wrote:
Wed Aug 30, 2017 4:57 pm
Okay, so Linux possible rather than Linux mandatory.
Yes, and that's so that I can actually help you with coding...
Demiansky wrote:
Wed Aug 30, 2017 4:57 pm
I'm wondering though how one uses C++ with Unity.
As I described above: compile the C++ code into a DLL, and use that from the interface code (which is in C# and uses unity).
Demiansky wrote:
Wed Aug 30, 2017 4:57 pm
I think I remembering reading that there was a pluggin or something to that effect, but also heard that there were a few confounding issues
I think that that is a way of doing the interface code, which needs unity, in C++. We suggest no such thing, merely that the simulation code, which does not need unity, is written in C++.
Programming SotE.

Demiansky
Posts: 48
Joined: Thu Jun 22, 2017 4:03 pm

Re: The Calandiel/David joint plan.

Post by Demiansky » Wed Aug 30, 2017 7:14 pm

David Buunk wrote:
Wed Aug 30, 2017 5:03 pm
Demiansky wrote:
Wed Aug 30, 2017 4:57 pm
Okay, so Linux possible rather than Linux mandatory.
Yes, and that's so that I can actually help you with coding...
Demiansky wrote:
Wed Aug 30, 2017 4:57 pm
I'm wondering though how one uses C++ with Unity.
As I described above: compile the C++ code into a DLL, and use that from the interface code (which is in C# and uses unity).
Demiansky wrote:
Wed Aug 30, 2017 4:57 pm
I think I remembering reading that there was a pluggin or something to that effect, but also heard that there were a few confounding issues
I think that that is a way of doing the interface code, which needs unity, in C++. We suggest no such thing, merely that the simulation code, which does not need unity, is written in C++.
Well, yeah, but I'm trying to envision how compiling C++ into a DLL plays out during the actual development process. So if I'm working in Visual Studio or monodevelop, does it automatically compile each time I punch the button to play the game? Or is there some intermediary process?

User avatar
David Buunk
Posts: 75
Joined: Thu Jun 22, 2017 4:46 pm
Location: Netherlands

Re: The Calandiel/David joint plan.

Post by David Buunk » Thu Aug 31, 2017 2:42 am

When developing the simulation code, you hit the "build" button, which figures out what needs to be recompiled, re-compiles that, puts the dll in the right place. Then you start the game to test.

When developing the interface code, it would work just like now.
Programming SotE.

Demiansky
Posts: 48
Joined: Thu Jun 22, 2017 4:03 pm

Re: The Calandiel/David joint plan.

Post by Demiansky » Thu Aug 31, 2017 11:01 am

Alright, doesn't sound too complicated. Maybe I'll write a little more code in C# and then make the switch. It might sound like a waste, but I kinda want to be able to rewrite a nice chunk of the code in C# as a means to practice.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest