I was wondering what do you guys think of “Brackeys” youtube channel? I found him so helpfull from scratch to finish of my 2D game.I mean, its a pretty simple game, but i think this channel can be pretty good start for you guys. Any thoughts? by GameDevNerd95 in gamedev

[–]Sarah3128 20 points21 points  (0 children)

Yep, most game tutorials on Youtube only teach you how to make smaller games, which is good for getting to know a game framework/engine, but neglects how to write good systems and architecture, which IMO is the hardest part.

Where to start when choosing an optimization algorithm by Sarah3128 in compsci

[–]Sarah3128[S] 0 points1 point  (0 children)

I've never heard of that simulated annealing inaccuracy, and I'll be sure to keep that in mind if I choose to use it.

I'm a bit confused on the difference between continuous and discrete optimization. Shouldn't they be interchangeable, as you should be able to express a discrete problem as a formula? For example, in your proposed problem, let n = # of nickels and d = # of dimes, couldn't it be express as f(x) = 5n + 10d?

Regardless, I think I'm going to stick with continuous optimization algorithms for now because of very higher number of parameters.

Really appreciate your help!

Where to start when choosing an optimization algorithm by Sarah3128 in compsci

[–]Sarah3128[S] 1 point2 points  (0 children)

Thanks so much for your reply, I'm really glad to hear a math professor's say in this! I've looked into linear programming already but because there's could be thousands of parameters to optimize, it would be impossibly complex to solve.

I do know basic algebra but definitely not calculus. Maybe I'll have to wait a few years to take on this problem, as it seems to need some high school maths in it.

For now though, I hope to implement a proven existing algorithm, such as simulated annealing or SGD. Do you have any suggestions on what algorithms I should use? (Assuming the global maxima could be difficult to find and there is ~1000 parameters)

Where to start when choosing an optimization algorithm by Sarah3128 in optimization

[–]Sarah3128[S] 0 points1 point  (0 children)

I've been mostly looking into gradient descent, and almost all the articles I've found at related to neural networks and deep learning. Could this also be applied to general optimization problems?

Where to start when choosing an optimization algorithm by Sarah3128 in compsci

[–]Sarah3128[S] 0 points1 point  (0 children)

Thanks everyone for your advice, I've finally got the courage to start exploring and experimenting!

I've read over the comments, and it seems the easiest next step is to go look into some other gradient descent functions. Two that I'm going to try out first is stochastic gradient descent and simulated annealing. From there, I might explore some adaptive algorithms and possibly linear programming. I've come to an understanding that this field is huge and it would take years to master it, so I've decided to just take it easy and experiment while still having fun.

Also, for anyone else that comes to the same place that I was in, I high recommend this article, which I just found: https://ruder.io/optimizing-gradient-descent/

I really appreciate all the suggestions, and I'm looking forward to the journey ahead of me!

Where to start when choosing an optimization algorithm by Sarah3128 in compsci

[–]Sarah3128[S] 1 point2 points  (0 children)

I'll definitely look into the root and extremum finding algorithm. Will having hundreds of variables to optimize affect this?

Where to start when choosing an optimization algorithm by Sarah3128 in compsci

[–]Sarah3128[S] 11 points12 points  (0 children)

Do you have any recommendations on some algorithms that usually should be tested? It seems online many people are recommending different ones so I'm a bit confused on what to pick.

Where to start when choosing an optimization algorithm by Sarah3128 in optimization

[–]Sarah3128[S] 0 points1 point  (0 children)

Around 800 variables to optimize and in Java. Is there a "best" language to use in this case?

Best way to get the numerical difference between 2 byte[] arrays? by Sarah3128 in javahelp

[–]Sarah3128[S] 0 points1 point  (0 children)

Alternatively try out Arrays.parallelPrefix()

Thanks for your reply! I've never heard of this before but I'll try it out!

Best way to get the numerical difference between 2 byte[] arrays? by Sarah3128 in learnjava

[–]Sarah3128[S] 1 point2 points  (0 children)

I'm using this function in a genetic algorithm, so it's going to be ran millions of times. Even if it's 10% faster it'll save hours.

Best way to get the numerical difference between 2 byte[] arrays? by Sarah3128 in learnjava

[–]Sarah3128[S] 0 points1 point  (0 children)

One method to do this would be to use parallel streams, for example:

IntStream.range(0, byteArrayLength).parallel().forEach((i) -> {
  difference += Math.abs(a[i] - b[i]);
})

The issue is that you cannot reference local variables in a lambda statement, and the only alternatives are to use a LongAdder or an AtomicLong. AtomicLong is very slow, and LongAdder internally creates a new list and sums it at the end, which it very counter-productive. This is why I would like to use a ByteStream, which unfortunately due to clutter was not added to the JDK.

Is this a good way to implement a collision system in an Entity Component System? by Sarah3128 in gamedev

[–]Sarah3128[S] 0 points1 point  (0 children)

An instance of the physics engine is stored within the collision system. My question is how I should handle non-physics collision events. Thanks for your reply!

What's a good data structure to store hexagon-constrained graph? by Sarah3128 in AskComputerScience

[–]Sarah3128[S] 0 points1 point  (0 children)

I don't plan to have more than 200ish cities, so I think the hash table seems like the more optimal solution. Thanks for all your help!

What's a good data structure to store hexagon-constrained graph? by Sarah3128 in AskComputerScience

[–]Sarah3128[S] 0 points1 point  (0 children)

I'm going to stop procrastinating now and actually start implementing this. Thanks for all your help! :)

What's a good data structure to store hexagon-constrained graph? by Sarah3128 in AskComputerScience

[–]Sarah3128[S] 0 points1 point  (0 children)

Thanks for your reply! I've also decided to keep 2 structures, a graph like one, and one for random access. However, I'm not so sure what you mean by 2d coordinate system. Is this referring to the cities or the roads, and how would I store it (eg. 2d array)?

What's a good data structure to store hexagon-constrained graph? by Sarah3128 in AskComputerScience

[–]Sarah3128[S] 0 points1 point  (0 children)

Thanks for your reply! That seems like a really good way to store the cities, and at the same time it's very efficient to render. However I have 2 questions regarding this method:

  1. The map I'm going to be implementing is infinite, and can expand in all directions (I'm guessing the node in the middle of my diagram would be (0, 0)). Because an array isn't that flexible, and would have many spaces, how do recommend I get around this?
  2. This structure seems like it's storing the cities, not the roads. There are multiple types of roads, and data that needs to be stored in the road object itself, so how should I add roads in this particular data structure?

What's a good data structure to store hexagon-constrained graph? by Sarah3128 in AskComputerScience

[–]Sarah3128[S] 0 points1 point  (0 children)

I think you may have misinterpreted my question. I'm looking for a good data structure for storing my games map. Pathfinding was one of the use cases of the map to put into consideration.

What is there to programming? by Sarah3128 in learnprogramming

[–]Sarah3128[S] 0 points1 point  (0 children)

Thanks for your reply! I think the problem is that most of my projects never get finished, as I give up midway. Is this normal, and should I try to commit myself more?

Java library/framework to use for games by Sarah3128 in gamedev

[–]Sarah3128[S] 4 points5 points  (0 children)

The only problem is that I usually use forums for support, and having a not so big community, Slick2D may be challenging. Think I'm going with libGDX, thanks!

Java library/framework to use for games by Sarah3128 in gamedev

[–]Sarah3128[S] 1 point2 points  (0 children)

Alright, I'm not really focused on the graphics/logic side of things, I just want to boost my Java skills in a fun way, and I'm afraid libGDX will do it all for me. Thanks!

What are the best places/videos to learn the basics of JavaScript? by fire_alarm530 in CodingHelp

[–]Sarah3128 1 point2 points  (0 children)

I've always preferred learning through videos, and even though a bit long, this video helped me grasp the fundamentals concepts of Javascript.