I was invited to a job interview on Monday, they are looking for a C/C++ programmer. I was wondering would it be a dumb idea if I would bring my laptop and show them my game engine code written in C++ ? I don't have much to offer; I have no job experience, or references, just my diploma, and the engine is my biggest project (around 30 000 lines of code). I also have 2 days to learn python...
Bring your laptop!
[QUOTE=AntonioR;48966189]I also have 2 days to learn python...[/QUOTE]
No one (that already programs) needs to learn Python.
protip: don't use un-initialised variables in a CUDA kernel.
I wanted to see if I could get our game API we made for arcade working in UE for my Architecture game. Gave myself a week, took two.
The game API and games are C# and uses UE to handle input, audio and graphics.
[vid]http://files.facepunch.com/Layla/2015/October/23/2015-10-23_17-39-48.mp4[/vid]
Really satisfying to play.
Some keys for prototypes if anyone here hasn't got one yet.
[code]
FLRP6-WYH8C-BL69W
TZVHC-R222A-IGWNT
A6F9Y-LJB4L-ETXA5
DA86P-0HZKZ-KRDLP
[/code]
Thanks, I got the first one
Got the third one starting from the top.
thanks, took them all
[QUOTE=Karmah;48959215]I'll keep that library in mind, as one I finish my port I will end up having to eventually design a 2d UI system for menus and stuff[/QUOTE]
I also can recommend imgui (again) because I am still working on my synthesizer which atm looks like this:
[img]http://i.imgur.com/aLUCtQk.png[/img]
note that the setting tab is opened too just to show off, the whole interface is going to change but not before scripted sounds will start to work.
Actually at the beginning of the project there weren't plans to have the sounds synthesized by code, but then I saw [url=http://www.iquilezles.org/apps/soundtoy/]soundtoy[/url] and decided to go for it.
we are both using default skin, but I am doing it because I am lazy :v:
So I haven't programmed in ages but I literally just started programming again. I'm working on writing a simple vectormath library for arduino, but at this point I have alternate ideas and may move to ARM and TI stuff instead (back to that in a moment)
[CODE]// Vector products library, capable of taking cross, dot, and unit vectors.
double x1,x2,x3,y1,y2,y3,z1,z2,z3,t1,t2,t3; //setup variable inputs for vector coords, double type for high precision. x y and z are generic, t is for parametric
//define generic structure for vector, i,j,k in terms of xyz
typedef struct{
double i,j,k;
}vector;
vector a={x1,x2,x3} b={y1,y2,y3} c={z1,z2,z3}
void setup(){
}
double dotproduct(vector a,vector b){
return a.i*b.a.j*b.j+a.k*b.k;
}
// Calculate cross product of a and b
double crossproduct(vector a, vector b){
vector c = {a.j*b.k-a.k*b.j, a.k*b.i-a.i*b.k, a.i*b.j-a.j*b.i};
return c;
}
// Saving our calculated vector a into nonvolatile memory, then telling the console we have saved it. Implementing tracking of used space would be wise plus where the hell I save the damned things
void savevector(vector a){
const double signMessage[] PROGMEM = {a.i,a.j,a.k};
Serial.print("\n Vector a saved to flash memory")
}
// Load a vector from flash into volatile SRAM for use in a program
void loadvector(vector a){
}[/CODE]
WIP as fuck, because I literally haven't programmed a damn thing in two years and C for the ArduinoIDE is all I ever used. That IDE is wretched btw, notepad++ is so much nicer and dark themes are the only way to not melt your retinas at 2am. Anyways, the atmega2560 does not even have a hardware divide/multiply ability, and no FPU. So I have to wait for this to be all emulated in software, which destroys computation times. And my use of doubles there is completely pointless, since the chip can't even use those. I'm thinking of moving to a dev board with a Cortex-M4F chip onboard since those have hardware divide/multiply, actual goddamn FPU's, and usually loads more flash memory as a bonus. And can still be lower power. And can be had for $15 from Mouser.
Or I can keep my stack of literally 5 mega 2560's and try to find some way to do fixed point approximation and change all vectors to unit vectors on output/final calculation. Which should work since the unit vector can be used as a rate. I think. My head is a bit mushy from my diff eq exam this morning. But I'm having fun even programming (poorly) again :v:
[editline]23rd October 2015[/editline]
[QUOTE=vombatus;48966921]I also can recommend imgui (again) because I am still working on my synthesizer which atm looks like this:
note that the setting tab is opened too just to show off, the whole interface is going to change but not before scripted sounds will start to work.
Actually at the beginning of the project there weren't plans to have the sounds synthesized by code, but then I saw [url=http://www.iquilezles.org/apps/soundtoy/]soundtoy[/url] and decided to go for it.
we are both using default skin, but I am doing it because I am lazy :v:[/QUOTE]
Also this is really neat. Pls gib a .vst at some point and I'll play with it. Add things like aftertouch modulation and routing, and a few independent LFO's and I'll love you forever <3
[QUOTE=MatheusMCardoso;48966366]No one (that already programs) needs to learn Python.[/QUOTE]
I'm one that often advocates against python but the simple fact of the matter is that a lot of people use it.
Also, immediate mode UIs are icky, you can't properly layout or anything with them :v:
[QUOTE=paindoc;48967142]
Also this is really neat. Pls gib a .vst at some point and I'll play with it. Add things like aftertouch modulation and routing, and a few independent LFO's and I'll love you forever <3[/QUOTE]
um, what's a vst? :v:
first version had this:
[code]
double omega = 2*M_PI*baseFrequency;
double period = 1 / baseFrequency;
unsigned int samples = period*Constants.samplesPerSecond;
double x = 0;
for (unsigned int i = 0; i < samples; i++) {
playSamples[i] = Globals.volume*sin(omega*x);
x += 1.0/Constants.samplesPerSecond;
}
if (!playSoundBuffer.loadFromSamples(playSamples, samples,
...[/code]
but then I realized that it's going to be poop, unusable and boring and then I saw soundtoy. you really should check it out (or wait a bit till my first release ;o).
That's what my plan is - to have kewl things like resonance and other stuff all be programmed. But I also want for my software to be used and liked, so when things will start to work I am undoubtfully going to add that what's called LFO and everything that you are suggesting because they are helpful and looks like going are to be needed in real world
[QUOTE=Map in a box;48967280]I'm one that often advocates against python but the simple fact of the matter is that a lot of people use it.
Also, immediate mode UIs are icky, you can't properly layout or anything with them :v:[/QUOTE]
I find that for most of my applications (like tooling) you don't actually need super fancy layouting, most immediate mode ui stuff does some basic layouting (put in a frame and layout horizontally or vertically).
It's there to empower programmers to create interfaces quickly and easily, while minimizing state, it's just lovely for developing tools (like the particle system editor i'm making right now), because you don't have to go back and forth through the world of the UI and back into your program.
Retained mode UI's still have their place when you can't resolve everything in a single pass, and when you have more complex layout requirements.
Generally I find that the simplicity that comes from immediate mode ui's is often nice, and sometimes highlights the shit you have to trawl through in a similar retained mode ui.
Unrelated but it would appear they silently removed the discount for previous owners of DX:HR to get the directors cut. Woww
[QUOTE=Rocket;48967529]I'm not sure if you're in the wrong thread or not.[/QUOTE]
no but most of the other parts of FP are incredibly toxic
[editline]23rd October 2015[/editline]
Also planned to automerge it, but w/e
[QUOTE=vombatus;48967362]um, what's a vst? :v:
first version had this:
[code]
double omega = 2*M_PI*baseFrequency;
double period = 1 / baseFrequency;
unsigned int samples = period*Constants.samplesPerSecond;
double x = 0;
for (unsigned int i = 0; i < samples; i++) {
playSamples[i] = Globals.volume*sin(omega*x);
x += 1.0/Constants.samplesPerSecond;
}
if (!playSoundBuffer.loadFromSamples(playSamples, samples,
...[/code]
but then I realized that it's going to be poop, unusable and boring and then I saw soundtoy. you really should check it out (or wait a bit till my first release ;o).
That's what my plan is - to have kewl things like resonance and other stuff all be programmed. But I also want for my software to be used and liked, so when things will start to work I am undoubtfully going to add that what's called LFO and everything that you are suggesting because they are helpful and looks like going are to be needed in real world[/QUOTE]
.vst is the extension that most DAW's load, so when you go to exporting a final version of the project you can create a vst. this is a plugin that can be then loaded into a daw and dropped into (most likely midi) tracks to be used for songmaking. the daw then sends midi data to the plugin and the plugin generates the appropriate sounds.
[QUOTE=alien_guy;48966392]protip: don't use un-initialised variables in a CUDA kernel.[/QUOTE]
I'm not sure if this is a joke or not, but just to make this clear:
protip: don't use un-initialised variables
You don't need to add anything. This is it. Don't do it man.
[QUOTE=mastersrp;48968172]I'm not sure if this is a joke or not, but just to make this clear:
protip: don't use un-initialised variables
You don't need to add anything. This is it. Don't do it man.[/QUOTE]
Pretty sure the code would have worked fine on the CPU though.
[editline]edit[/editline]
actually, probably not
[QUOTE=mastersrp;48968172]I'm not sure if this is a joke or not, but just to make this clear:
protip: don't use un-initialised variables
You don't need to add anything. This is it. Don't do it man.[/QUOTE]
I feel like there are exceptions to this. For example, if you declare a static array in C. The standard guarantees it will be zeroed out and it's a hassle to manually pretend to initialize it.
[QUOTE=Darwin226;48968412]I feel like there are exceptions to this. For example, if you declare a static array in C. The standard guarantees it will be zeroed out and it's a hassle to manually pretend to initialize it.[/QUOTE]
But in your example the standard guarantees you will get an zero [I]initialized[/I] array, so it doesn't really count.
I basically went from:
[CODE]float x;
x = random();[/CODE]
to
[CODE]float x;
for(int i = 0;i<n;i++)
x += random();
x/=n;[/CODE]
And didn't think about it.
Oh man, the feeling of refactoring a bunch of code and getting rid of redundancies and ugly blocks.. I'm going file-by-file through my enterprise app's codebase and cleaning things up and employing a template + config system. Even though no new features have been added, the fact that I can look at the source and feel some pride is a great feeling.
[QUOTE=Profanwolf;48957471]You could always scrap the QT based editor and go for something based on like: [url]https://github.com/ocornut/imgui[/url]
Where all the editor functionality is in-engine and just built with this, the paradigm for doing UI that way is a bit different, but it massively reduces the amount of boilerplate.
(it's what i'm doing for my engine pretty much)
rudimentary example from me testing controller functionality:
[img]http://i.imgur.com/HeLE0xV.png[/img]
afaik blender is also built on an immediate mode ui, basically you just say "make button" and they only appear *if* you submit the command for that given frame, so the structure for your UI looks more like the one for your code (conditionals and stuff).
It makes it really nice to build debug ui's for stuff, since you don't retain data inside the UI itself, you just use what's in your program already.
You can look at some samples of how people are using it here: [url]https://github.com/ocornut/imgui/issues/123[/url]
(worth a look at least, not telling you to throw away everything :v:)[/QUOTE]
imgui looks seriously slick but then again, I like rolling my own implementations of things just for the learning experience :v:
also physics properly works now (with pre-defined scales and everything, non-convex mesh collisions still broke tho):
[vid]https://dl.dropboxusercontent.com/u/357850863/ShareX/2015/10/2015-10-23_19-55-34.mp4[/vid]
Another big thing is cross-platform building using cmake, although it doesn't show up correctly on Mac OSX (the only other OS I actually have readily access to :v:) it does compile, so it's [I]something[/I]. Homebrew is also fucking awesome for solving dependices. Not much else is added, I added a crappy material system so I don't have hard paths for textures anymore, that's pretty much it for now.
Now time for ~some~ optimization so I can play around with physics at a reasonable fps.
[QUOTE=alien_guy;48968597]I basically went from:
[CODE]float x;
x = random();[/CODE]
to
[CODE]float x;
for(int i = 0;i<n;i++)
x += random();
x/=n;[/CODE]
And didn't think about it.[/QUOTE]
What's the advantage of the latter? It looks like it would have the same output range as the simpler one.
[QUOTE=Berkin;48969291]What's the advantage of the latter? It looks like it would have the same output range as the simpler one.[/QUOTE]
Same range, but not the same distribution. Imagine if n is huge, then you would expect the final value of x to be very close to 0.5
[QUOTE=Berkin;48969291]What's the advantage of the latter? It looks like it would have the same output range as the simpler one.[/QUOTE]
I was generating random rgb values for testing image saving, wanted to see if the output would converge on grey like i expected with multiple iterations.
here this makes it pretty clear:
[IMG]http://i.imgur.com/02woJWj.png[/IMG]
10,000 samples and 10,000 iterations on the random averaging
purple is the normal random function, red (black) is the accumulated and averaged
[QUOTE=Winner;48969598]this is such a fucking stupid and short-sighted post, it completely depends on what you're trying to do
making a 3d game? use c#, java, unity, whatever...
interactive data analysis? use jupyter with python, haskell or r
writing a spark application to offload some heavy tasks to a cluster? use python or java
plus it's [I]extremely[/I] convenient to know an interpreted language for being able to punch out a quick script without setting up a proper dev environment (doing stuff on an ec2 instance, someone else's computer...), or when you need to make and rapidly update a simple script without creating extra project files or compiling every time, etc. your options for this are pretty much python, perl, and ruby, and python is by far the easiest to learn and the most actively used at the moment.[/QUOTE]
I wish Lua got more love.
definitely still one of my favourite languages
but python's pip just works too well most of the time
meanwhile I've long given up trying to get luarocks working on this machine
I love Lua, but maaan
[QUOTE=Winner;48969598]this is such a fucking stupid and short-sighted post, it completely depends on what you're trying to do
making a 3d game? use c#, java, unity, whatever...
interactive data analysis? use jupyter with python, haskell or r
writing a spark application to offload some heavy tasks to a cluster? use python or java
plus it's [I]extremely[/I] convenient to know an interpreted language for being able to punch out a quick script without setting up a proper dev environment (doing stuff on an ec2 instance, someone else's computer...), or when you need to make and rapidly update a simple script without creating extra project files or compiling every time, etc. your options for this are pretty much python, perl, and ruby, and python is by far the easiest to learn and the most actively used at the moment.[/QUOTE]
I interpreted that as "If you can program in [I]something[/I], you can program in Python already.", since the language is extremely easy to use for the most part.
Sorry, you need to Log In to post a reply to this thread.