Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Hadlock
Nov 9, 2004

I want to model a system, sort of like how Sim Tower started off life as an elevator systems model... a very basic 2D engine with some generic moving parts. I was looking at simulating a model of an airport, specifically the airstrip, terminals, parking and moving passengers from parking to the airplane through the concourse, based on different layouts and various constraints.

Is there a general engine/platform I could look at for this sort of thing?

Some things I've looked at so far and not been terribly impressed with were

Love2d (Lua)
libtcod (Python/C++/.net)
Construct 2
RPG Maker

Etc etc but these seem very pidgeonholed in to making a very specific type of game. I am a couple steps above a script kiddie but don't have the knowledge needed to build my own rendering engine etc. I feel like I might be better off re-purposing some sort of Checkers or Othello open source game and working from there.

Adbot
ADBOT LOVES YOU

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Almost any programming language is acceptable for writing a simple 2d simulation program. Personally I'd just knock together a prototype in straight Java or Processing, as I am comfortable with both. What do you think a game engine or an existing codebase would do for you that you feel uncomfortable writing from scratch?

Hadlock
Nov 9, 2004

I took objective based C++ in high school (this was a year or two before Java at the HS/Uni level exploded) and 99% of our work was reading and writing to text files, arrays, bubble sorts, structs, hidden functions, etc.. very business based programming. Most of what I do for work is Bash scripting, SQL queries and some powershell. We very briefly touched on some goofy Carnagie Mellon University graphics library in high school, drawing squares that changed color in the last week of class.

So I'm fairly nervous about getting my hands dirty writing some sort of slow, kludgy graphics when really I just want to write the logic under it. In theory some sort of game engine would let me bypass a lot of that. Also I guess I did a lot of Quake 1, 2 and TF2 level design at some point in the distant past.

nielsm
Jun 1, 2009



For that kind of game I would look for two things in an engine: Tile-based maps, meaning a rather coarse grid-based map where things are nominally positioned at whole coordinates of, and freely moveable sprites, i.e. can be positioned at non-whole tile coordinates.
The former because it's the easiest way to think about a map, the latter because you probably want smooth movements. Think of the elevators moving between floors in SimTower, nominally an elevator is always at one floor or another, but it will be shown as partway between two while transitioning.

The actual simulation logic should only be bound loosely to the engine, and not depend too much on it.
You still have to consider for yourself how you want to represent the maps (types and shapes of rooms, handling of walls and doors, and such) and the agents involved.
If you haven't, watch some of the technical presentation videos about the new SimCity, where the developers talk about the Glassbox engine, it's pretty neat and you should be able to get some inspiration from it on how to handle this kind of simulation.

Hughlander
May 11, 2005

Master_Odin posted:

I mean, I'm having issues I guess with how things are defined and the path they take. Like I've got validation code being run in app.configure(). Not great as it runs on every request (which isn't bad actually I guess?).

Anyway, this is fine, the function gets called, except the result are done AFTER the path is finished up, so any user validation I might have done in the code is then broken. This might be because the validation is done through an AWS call to a dynamoDB for session table and I guess printing a page is quicker than waiting for the DB result. This is a weird thing to me as there's no real seeming way to tell the code "run this function, then proceed to this function, and you have to WAIT for the first function" which leads to stuff like my issue and the desperate feeling like I need semaphores and data locking which isn't supposed to be in node.js at all.

app.use() can be used to create middleware functions that put themselves anywhere in the pipeline, try that instead.

raminasi
Jan 25, 2005

a last drink with no ice

Pygame?

ToxicFrog
Apr 26, 2008


Hadlock posted:

So I'm fairly nervous about getting my hands dirty writing some sort of slow, kludgy graphics when really I just want to write the logic under it. In theory some sort of game engine would let me bypass a lot of that. Also I guess I did a lot of Quake 1, 2 and TF2 level design at some point in the distant past.

So...why is love2d inappropriate for that? It's not designed for "a specific kind of game" beyond assuming 2d graphics of some kind.

Pygame or pyglet may also be worth a look.

Hadlock
Nov 9, 2004

I wonder if gutting a project like LinCity or OpenTTD would be easier than writing something from scratch? Pyglet + Cocos2d looks promising, thanks for the suggestions!

Econosaurus
Sep 22, 2008

Successfully predicted nine of the last five recessions

Is there a webpage or sheet I could print out that has all the most common HTML/CSS/jQuery/Javascript commands and a short thing on what they do? It'd be easier than having to figure out what I need and look up the syntax and everything every time.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

Econosaurus posted:

Is there a webpage or sheet I could print out that has all the most common HTML/CSS/jQuery/Javascript commands and a short thing on what they do? It'd be easier than having to figure out what I need and look up the syntax and everything every time.

All of them together will be hard to find on one page. You can google "technology cheat sheet" for separate results, or buy something like this: http://www.visibone.com/products/ccvbb.html

theratking
Jan 18, 2012
I'm looking for a good resource on optimization problems. Namely, books with good coverage of stuff like:

- Linear Programming
- Local Search
- Gradient Descent (for convex functions)
- etc.

This might be the wrong thread, but it seems the book recommendation thread is dead...

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Are you just looking for algorithms, or do you want books that discuss problem formulation as well?

theratking
Jan 18, 2012

ultrafilter posted:

Are you just looking for algorithms, or do you want books that discuss problem formulation as well?

A focus on algorithms would probably be preferred, but I'm interested in both aspects.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


I don't think there's any one book that covers everything you want, but there's a shortlist that will cover most of what you want. There are other books on all of these topics, so look around at the Amazon suggestions as well as what I point to.
  • Boyd & Vandenberghe is the book on convex optimization, and free to download as well.
  • Nocedal & Wright is a popular text on numerical optimization. That's going to be your best bet for a general algorithms book.
  • Bertsimas & Tsitsiklis is a pretty standard book on linear programming. They include enough algorithmics to get by, but the emphasis is really on understanding what problems can be formulated as linear programs.
  • Bertsekas seems to be the standard introduction to general nonlinear programming.
  • Michalewicz & Fogel is a decent book on local search and other heuristics, but I can't forgive them for titling their book after Polya's classic.
  • Finally, Sundaram is a standard introduction to the general theory of optimization. It's missing a section on duality, but everything else is well-presented and it's cheap, so why not?
Those are the core topics and enough to get you started with many things. Do you need books on dynamic programming or integer programs?

As an aside, right now a question like this doesn't have a better home, but this really isn't the thread for it. Should we have a separate "small algorithmic/theory questions" thread?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ultrafilter posted:

As an aside, right now a question like this doesn't have a better home, but this really isn't the thread for it. Should we have a separate "small algorithmic/theory questions" thread?

I'd wait until there's a deluge of such questions in is thread. YAGNI and all that.

theratking
Jan 18, 2012
Thanks ultrafilter that's definitely a decent list to get started. This is partly for me and partly for a CS class at the college I attend. Our textbooks for the class are Introduction to Algorithms and Algorithms (Dasgupta et al).

The class is currently looking for suggested reading pertaining especially to optimization problems. This list helps!

In regard to dynamic programming and integer programs (we just had a lecture on them today!), I'd love some resources.

Doctor w-rw-rw-
Jun 24, 2008

theratking posted:

Thanks ultrafilter that's definitely a decent list to get started. This is partly for me and partly for a CS class at the college I attend. Our textbooks for the class are Introduction to Algorithms and Algorithms (Dasgupta et al).

The class is currently looking for suggested reading pertaining especially to optimization problems. This list helps!

In regard to dynamic programming and integer programs (we just had a lecture on them today!), I'd love some resources.

Dasgupta is actually the best text I can think of.

There's an online version, by the way.

pipes!
Jul 10, 2001
Nap Ghost
I'm very slowly teaching myself to be better at command line stuff, and to do that I'm attempting to hamfistedly mash the prompt into something that I'd consider more user-friendly. This is what I've got so far:



What I'm wondering is if there's a way to adjust the coloring of everything to the left of the directory and file listings? I've done a fair amount of googling but only find ways to adjust the rightmost column. I'm not even sure if I'm using the proper terms?

Rothon
Jan 4, 2012

pipes! posted:

I'm very slowly teaching myself to be better at command line stuff, and to do that I'm attempting to hamfistedly mash the prompt into something that I'd consider more user-friendly. This is what I've got so far:



What I'm wondering is if there's a way to adjust the coloring of everything to the left of the directory and file listings? I've done a fair amount of googling but only find ways to adjust the rightmost column. I'm not even sure if I'm using the proper terms?

I don't think there's a way of doing it within ls itself, but you can wrap it in a script that pipes the output through sed or awk or something that'll add in color control characters.

pipes!
Jul 10, 2001
Nap Ghost

Rothon posted:

I don't think there's a way of doing it within ls itself, but you can wrap it in a script that pipes the output through sed or awk or something that'll add in color control characters.

Thanks for this, it's definitely set me in the right direction. Going off your post I stumbled across this post, which seems to be what I want, more or less. Time to learn some regexes, I guess!

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Master_Odin posted:

I mean, I'm having issues I guess with how things are defined and the path they take. Like I've got validation code being run in app.configure(). Not great as it runs on every request (which isn't bad actually I guess?).

Anyway, this is fine, the function gets called, except the result are done AFTER the path is finished up, so any user validation I might have done in the code is then broken. This might be because the validation is done through an AWS call to a dynamoDB for session table and I guess printing a page is quicker than waiting for the DB result. This is a weird thing to me as there's no real seeming way to tell the code "run this function, then proceed to this function, and you have to WAIT for the first function" which leads to stuff like my issue and the desperate feeling like I need semaphores and data locking which isn't supposed to be in node.js at all.

Javascript is asynchronous, if you need to do something sequentially the two options in javascript are either callbacks or promises. Depending on how you make your call to the DB you may have to wait for an event to fire before executing the callback.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


theratking posted:

In regard to dynamic programming and integer programs (we just had a lecture on them today!), I'd love some resources.

Wolsey for integer programming, Chiang for dynamic programming.

Tres Burritos
Sep 3, 2009

What funky language can I learn that

a) has good support on linux
b) I can make a simple game with

I want to learn something new, and I want to make a game. My wheelhouse is C#, Java, C++, C the farther away you can get from that, the better.

unixbeard
Dec 29, 2004

What about processing https://www.processing.org

Opinion Haver
Apr 9, 2007

Tres Burritos posted:

What funky language can I learn that

a) has good support on linux
b) I can make a simple game with

I want to learn something new, and I want to make a game. My wheelhouse is C#, Java, C++, C the farther away you can get from that, the better.

Haskell :shepface:

e: I'm not entirely joking. It's definitely going to be something new, though I don't know which game libraries are good.

Opinion Haver fucked around with this message at 07:14 on Apr 13, 2013

Hadlock
Nov 9, 2004

Tres Burritos posted:

What funky language

Assembly

Other, more realistic hipster coder options

Ada - work for an insurance company!
COBOL - work for the government repairing 1980s era weapons systems!

Every couple of years someone releases a custom built window/GUI system that will boot on a floppy and only uses 150KB or so in assembly. But they're completely insane. Systems 1-6 for the Mac was written in assembly and fit on a n 800kb floppy (and holy hell are they fast, even by today's standards).

Hadlock fucked around with this message at 06:14 on Apr 13, 2013

shrughes
Oct 11, 2008

(call/cc call/cc)

Hadlock posted:

Ada - work for an insurance company!
COBOL - work for the government repairing 1980s era weapons systems!

Did you intentionally mix these up?

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Tres Burritos posted:

My wheelhouse is C#, Java, C++, C the farther away you can get from that, the better.

Learn Forth!

Many garden-variety implementations work under linux and are capable of calling out to C libraries like SDL, OpenGL, etc.

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.

Hadlock posted:

Assembly

Other, more realistic hipster coder options

Ada - work for an insurance company!
COBOL - work for the government repairing 1980s era weapons systems!

Every couple of years someone releases a custom built window/GUI system that will boot on a floppy and only uses 150KB or so in assembly. But they're completely insane. Systems 1-6 for the Mac was written in assembly and fit on a n 800kb floppy (and holy hell are they fast, even by today's standards).
Haha, my school is pushing COBOL big time and I'm actually considering the graduate courses:

quote:

The program is offered in certificate form as well as components of existing undergraduate and graduate degree programs. The program provides participants with a global understanding of IBM System Z with special attention given to system administration and ZOS, COBOL programming, CICS and Transaction Processing Systems, DB2 administration and application development. The program is designed to help participants become proficient in these areas in order to become employed at one of many top-tier companies deploying System Z.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
Hello Goons,

While using Heroku I've noticed a little quirk happens; when the server restarts (whether it goes into idle, or by hand), it's deleting images that I download onto the server from my program. Does anyone know why this is, and what I can do to stop it? Thanks!

E: Nevermind, apparently I need an S3 account or similar: http://stackoverflow.com/questions/10425843/everytime-push-to-heroku-images-is-not-showed-paperclip

Knyteguy fucked around with this message at 17:31 on Apr 13, 2013

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Tres Burritos posted:

What funky language can I learn that

a) has good support on linux
b) I can make a simple game with

I want to learn something new, and I want to make a game. My wheelhouse is C#, Java, C++, C the farther away you can get from that, the better.

You could try javascript with html5. I've been making games with it and its pretty good. A lot of people rag on javascript, some of it deservedly, but there's some good features, especially closures, and I find it pretty fun to write. You'll be able to get something up on the screen pretty quickly. And it's a fairly different paradigm from the static typed languages you're used to. Be sure to read Crockford's webpage if you do.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

HappyHippo posted:

You could try javascript with html5. I've been making games with it and its pretty good. A lot of people rag on javascript, some of it deservedly, but there's some good features, especially closures, and I find it pretty fun to write. You'll be able to get something up on the screen pretty quickly. And it's a fairly different paradigm from the static typed languages you're used to. Be sure to read Crockford's webpage if you do.

I'll ditto this, Javascript can be kind of a pain in the rear end, but it's been really fun so far regardless.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
Also I can't stress how cool it is to share your game with friends by just giving them a link. No downloads or installs, just "here try my game."

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
Hey Goons,

Does anyone know of a good software license for my needs? I'm creating a website that's been a ton of work... I didn't really want to open source it, but I needed something good for my resume, so I added the entire project to Github. Basically I don't mind if people look at my code, and learn from it or whatever if they can, but I don't want them selling it or actually putting it on their own website as-is (my whole website is literally open-source now). Is there a good license for this? How can I protect my work?

Thanks!

Opinion Haver
Apr 9, 2007

If you don't want people to do anything with your code, why don't you just publish it and say 'all rights reserved' or whatever? Usually when people say 'open source' they mean that people are free to do more than just look at it.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

yaoi prophet posted:

If you don't want people to do anything with your code, why don't you just publish it and say 'all rights reserved' or whatever? Usually when people say 'open source' they mean that people are free to do more than just look at it.

Alright I'll do that thanks.

tef
May 30, 2004

-> some l-system crap ->

Knyteguy posted:

I'm creating a website that's been a ton of work... I didn't really want to open source it, but I needed something good for my resume, so I added the entire project to Github.

iirc github is only free for open source projects. You may want to host your code elsewhere. if you're looking to make it awkward to do anything but run it, just run it through a source code highlighter and only publish the html :v:

quote:

Basically I don't mind if people look at my code, and learn from it or whatever if they can, but I don't want them selling it or actually putting it on their own website as-is (my whole website is literally open-source now).

Unless your code is well documented, and thoroughly tested, it is unlikely people will pick it over existing solutions. A simple copyright might not add much as a deterrent.

quote:

Is there a good license for this? How can I protect my work?

As mentioned, Standard copyright, i.e "all rights reserved" should cover you, and it is the default case for published things. Legally, adding 'all rights reserved' is really just making it clear IIRC. However, once you have published the code there is very little you can do if someone copies it or runs it without your permission. Personally I doubt you will lose many nights sleep over making your code actually open source. :3:

Whether you like it or not, if your ideas are good other people will copy them, and perhaps the code too if they're exceptionally lazy. If your ideas aren't so good, you don't have to worry so much about other people using your code.

Opinion Haver
Apr 9, 2007

tef posted:

If your ideas aren't so good, you don't have to worry so much about other people using your code.

I dunno about that, people sure do seem to use [thing that you don't like] and [other thing you don't like] a lot!

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

tef posted:

iirc github is only free for open source projects. You may want to host your code elsewhere. if you're looking to make it awkward to do anything but run it, just run it through a source code highlighter and only publish the html :v:

Atlassian's Bitbucket have private repositories for up to 5 users, if you want somewhere to host your code repo for free and privately. Most of my stuff I just do through there.

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
There is no default license of all GitHub projects. You retain all copyright. Sharing the source code for viewing is not equivalent to giving them a license to use it.

You can put it under share-alike conditions, which say "if you want to use this, you must share any and all changes back to me". This would be something like the AGPLv3 or MPLv2.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply