Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Go Down

Legend

How's it going?
Still holding off from writing any code until Twisty Puzzle Simulator is out on Steam.

the-pi-guy

So I have 2 books that cover general AI techniques, another one for natural language understanding, and another for machine vision.  

I haven't been able to delve into any of them, except for my AI class, but I'm really excited to be able to do that.  

Legend

Still holding off from writing any code until Twisty Puzzle Simulator is out on Steam.
I am really starting to think this might be a good idea for all my games going forward and not just my 4D game.

As it is now I essentially create a new game engine for each game (outside of the core fundamental structure of Unity). VizionEck Cube Royale has a from scratch menu system, VizionEck Adventure has a seperate from scratch menu system, and Twisty Puzzle Simulator has "3" from scratch menu systems. It'd save so much time if I just had one core menu system that I could reuse.

Also Unity depreciated the low level transport layer I used to write my own multiplayer with. I knew UNet was getting the axe but I guess I just assumed the low level stuff would be safe. Yay.

Legend

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.

the-pi-guy

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.
I too subscribe to r/gamedev.  

Legend

I too subscribe to r/gamedev.  
I knew people would know I copied it from somewhere so I didn't bother sourcing it, but I didn't expect you to know the specific subreddit!

the-pi-guy

Apr 26, 2019, 12:45 PM Last Edit: Apr 26, 2019, 12:53 PM by the-pi-guy
I knew people would know I copied it from somewhere so I didn't bother sourcing it, but I didn't expect you to know the specific subreddit!
Wow, I just misread this seriously.

But yes.  :D

the-pi-guy

In PL we are learning about different ways to pass parameters.  

f(a,b){
b=a+b;
}

main(){
int a=1, b=2
f(a,b);
print(a, b)
}

by value: 1 2
by reference: 1 3
copy by value: 1 3
macro: 1 3

You can get wildly different answers, just depending on how things are evaluated.

Legend

In PL we are learning about different ways to pass parameters.  

f(a,b){
b=a+b;
}

main(){
int a=1, b=2
f(a,b);
print(a, b)
}

by value: 1 2
by reference: 1 3
copy by value: 1 3
macro: 1 3

You can get wildly different answers, just depending on how things are evaluated.

I was so confused when I first started realising arrays in C# were passed by reference instead of by value. At that time I only thought it happened to objects.

the-pi-guy

I was so confused when I first started realising arrays in C# were passed by reference instead of by value. At that time I only thought it happened to objects.
Aye!  


They kind of drill in the difference of how it works in school.  Especially right now.  


I didnt know about all these other ways.  

Copy restore is like in the middle of reference and value.  It basically copies the value, but at the end it writes the values back to the reference values.  


Macro expansion is weird.  You basically copy the function lines into the calling function, and then replace the variables by the ones being called in.  

So something like this:
f(c,d){
d=c+d
}

main(){
int a=1, b=2
f(a,b);
print(a, b)
}


Becomes:

main(){
int a=1, b=2
b=a+b;
print(a, b)
}


This has the unfortunate side effect that a reference to a global variable could get replaced by a local variable in a completely different function.

Legend

Is macro done by the compiler? I've heard of that being done where it's less of a function and more of just a way to avoid writing the same few lines of code in a lot of places.

the-pi-guy

Is macro done by the compiler? I've heard of that being done where it's less of a function and more of just a way to avoid writing the same few lines of code in a lot of places.
Yeah, all managed by the compiler.  

I don't think any compilers actually use macros for evaluation, but it is there.  

Legend


the-pi-guy

I'm really tired and frustrated.  Still making progress.  Forgot I made changes before running the program again, and was confused why it was suddenly working.  

the-pi-guy

Grammars are frustrating beasts.  

Trying to add a feature for an assignment, and for some reason the grammar is expecting '}' in a program, despite the fact that the only way to get there is by having a for statement.
So it's expecting something that there doesn't seem to be any reason it should be expecting.

Go Up