Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 649 650 [651] 652 653 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 909615 times)

majikero

  • Bay Watcher
  • Poi~
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9750 on: June 13, 2016, 09:03:08 pm »

A year into my dead end job I've decided to try my hand again at computer things.

What's a good programming language to kickstart my computer stuff prospects? Hoping for something to pan out in this field or I should go back to engineering.
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9751 on: June 13, 2016, 09:14:02 pm »

The choice of language depends on what you want to end up doing.

If just a general intro to scripting, Python.

If web, learn some PHP, SQL, JavaScript, by making an interactive website.

If games, try C# and Unity3D to start with. Then learn Java, and C++, which they were based on. C++ is the language of choice when you want to extremely fine-tune performance. All the big graphics/game engines are based on it, as it operating system coding.

But it really doesn't matter too much, any of those languages can give you some skills which are transferable to all the others. Porting your ideas from one language to another is good practice, and is also a skill that is valued.

A good rule of thumb is that to learn something like this in your own time, you need to have projects that you're actually interested in. If making games is that spark of interest, start with extremely small games: things you can complete in 1 week. If not finished, then abort the project, and scope out another one. This will give you good time management and planning skills. The failed projects go into your "parts bin" to be recycled for future games.
« Last Edit: June 13, 2016, 09:33:49 pm by Reelya »
Logged

majikero

  • Bay Watcher
  • Poi~
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9752 on: June 13, 2016, 09:30:57 pm »

But what about the website thing? I remember its part of what I've studied but honestly no clue how to even start practicing for most of what I've learned.

I guess I should start from the bottom again and work my way up but where do I start?
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9753 on: June 13, 2016, 09:39:21 pm »

You need to have some simple application you want to make with the web tech, then you can start researching what you need to make it a reality. Web stuff is not really something just following "tutorials" will teach you.

Where to start might be making a real basic HTML game. e.g. one of those ones where you log in, and can explore for land, buy farms or train troops.

The first step would be a pure HTML/CSS and JavaScript game that uses cookies to store state. These don't really need a server. e.g. Cookie Clicker. But you can develop one and then stick it on a free website.

The next step is to get a home-server setup. LAMP on linux, WAMP on Windows. This will let you simulate having an online environment with a database and PHP coding. You can then turn your javascript game into a full web app with persistence and a database.
« Last Edit: June 13, 2016, 10:00:33 pm by Reelya »
Logged

majikero

  • Bay Watcher
  • Poi~
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9754 on: June 13, 2016, 09:51:30 pm »

I've always hated those web games. I really should look at web stuff as examples rather than cancerous annoyances.
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9755 on: June 13, 2016, 11:42:52 pm »

Speaking of Unity, 2D Experimental Preview is now live.

SmartSprite apparently isn't in it, but 9-slice sprites and tilemaps are which is almost as good. 2D game development in Unity just got a whole lot easier.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Emma

  • Bay Watcher
  • Romace plots aren't actually that bad
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9756 on: June 14, 2016, 02:33:23 am »

Is updating worth it? I'm already using Tiled to do maps and the other bits do really effect me. Still, it's a great update.
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9757 on: June 14, 2016, 02:52:02 am »

Well, it's a beta preview thingy, so I wouldn't build anything super serious on it (especially since you bought Tiled). I'm definitely going to download and play with it (without overwriting my main Unity install of course).
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Emma

  • Bay Watcher
  • Romace plots aren't actually that bad
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9758 on: June 14, 2016, 02:58:31 am »

You know Tiled is free, right? I doubt I'll swap anyway, since getting Tiled2Unity working was a pain on Mac.
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9759 on: June 14, 2016, 03:25:54 am »

I couldn't find Tiled on a quick Google search for "unity tiled", so I assumed Tiled to Unity ($65) was the one you meant. :P
« Last Edit: June 14, 2016, 03:32:03 am by itisnotlogical »
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9760 on: June 14, 2016, 03:38:25 am »

I had to protect a bunch of vm so that they could talk each other but were firewalled to the outer world,
so I created a simple iptables wrapper script to be put in init, it uses a very simple configuration

#configure /etc/simplefw/simplefw.cfg like
#ALLOW 80
#HOST 192.0.2.23
#HOST6 2001:DB8:4860:3242

https://gist.github.com/LorenzoBoccaccia/12a0c305e0c72070049e4f25db672f49

anyone care to comment? I'm not an expert in the matter but I did cover stuff dns queryes and essential icmp packets and ssh
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9761 on: June 14, 2016, 04:47:40 pm »

@Mephisto:No he does not.nevermind

Also, 3man75, good grief, you NEVER need to import Object.

I want to help with this, but I'd end up completely rewriting your code and not really helping.

Also, you really, really, really need to learn more about how to write readable variable names...AND STOP MAKING MULTIPLE SCANNERS POINTED AT SYSTEM.IN FOR LIKE THE TENTH OR SO TIME AAAUGH.  Sorry.  I shouldn't shout.  But you only need the one Scanner, let's call it input, and then you can call input.nextInt() multiple times.

...Also, screaming about THIS METHOD IS BEING CALLED BY MAIN! is...Not a guaranteed truth, in addition to being really weird documentation-wise, because the line of code you wrote ISN'T being called in main, it's being called in your method.  One's code should not depend on being called by certain other code unless it's a private method, which I will not talk about because that's outside your current scope.

...Sod it, I'm going to write an unconnected example in the hopes that it actually gets through.

Code: [Select]
import java.util.Scanner;
public class Demo{
Scanner scan = new Scanner(System.in); //And notice how there is ONE Scanner, not two or three.
public static void main(String[] args){
//I'll avoid complicating things and just write it to go through each method once, though simply wrapping this with a while loop and implementing some sort of menu shouldn't be hard.
System.out.println("Input the initial value for instancevariable");
DemoObject whatdoesitdo = new DemoObject(scan.nextInt()); //Much less code to write than creating a new variable to store a value you only use once.

//Now, to demonstrate proper object-based I/O.

System.out.println("Called singleUseThing and got "+whatdoesitdo.singleUseThing()); //This is what a return statement is for.  It hands data back to the method that called things.
System.out.println("How many times would you like to call multiUseThing?");
int[] output; //Have to declare this outside of the loop so it doesn't vanish after the first iteration.
for(int count = 0, int max = scan.nextInt() /*Reusing a Scanner, see?  Also, you can do this comma thing here.*/, output = whatdoesitdo.multiUseThing(max); count<max; count++){
System.out.println("Result "+(count+1)+" of multiUseThing was "+output[count]);
}
}
}

public class DemoObject{
int instancevariable;
Random RNGesus = new Random();
DemoObject(int setup_value){
instancevariable=setup_value;
}

public void setInstanceVariable(int to_set){
instancevariable = to_set;
}

public int singleUseThing(){
return RNGesus.nextInt()*instancevariable;
}

public int[] multiUseThing(int num_times){
int[] temp_storage = new int[num_times];
for(int count = 0; count<num_times; count++){
temp_storage[count] = RNGesus.nextInt()*instancevariable;
}
return temp_storage; //Handing the array back for whatever.  If you only wanted to print odd-numbered results, you could do that without mucking up the object for uses that need all the results printed.
}

I apologize for the tabs, but it was much faster than spaces, especially because I typed this on my phone

Got it done just now and I killed off one of my scanners. An as for variable names..well that'll come later, as of now as the time of this writing.

Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9762 on: June 15, 2016, 03:37:37 am »

Wanting to set up a little chat client desktop app plus server for routing messages. Preferably using javascript inside windows native scripting host for the client and PHP for the server.

I know how to send stuff to a server, and to poll a server to see if there are any messages, but what I don't know is how to make an active listener that waits for a server to send messages to me (so that I can reduce the bandwidth needed for regular polling).
 
Can anyone tell me where to start with routing messages to my desktop client?

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9763 on: June 15, 2016, 04:19:04 am »

y firefox u do this

Spoiler (click to show/hide)


even edge can manage
Logged

monkey

  • Bay Watcher
    • View Profile
Logged
Pages: 1 ... 649 650 [651] 652 653 ... 796