I am moving back to Vermont in 2 days. I wrote a program that takes my GPS coordinates from my phone and uploads them to my website and displays them on a google map. It does so in near real time. With a few seconds of latency.
I wrote it so my friends can track my trip. :v:
Should I put the link online to the web page and risk some of you creepers abducting me?
[QUOTE=false prophet;47513770]
I wrote it so my friends can track my trip. :v:
Should I put the link online to the web page and risk some of you creepers abducting me?[/QUOTE]
I will abduct you from Australia m8
[QUOTE=layla;47512476]Ziks added basic multiplayer so we can run around San Andreas
[vid]http://files.facepunch.com/layla/2015/April/12/2015-04-12_20-12-00.mp4[/vid]
Not bad for a weekend of work[/QUOTE]
Holy shit. GTA:SA animations playing at that framerate feels really odd. (in a good way)
I own a [url=http://www.baronfig.com/pages/confidant]Baron Fig Confidant[/url] and set of [url=http://www.baronfig.com/pages/apprentice]Apprentices.[/url] I carry my Apprentice and a pen or a pencil with me all the time now, and I'm going to fill them with stuff for Vertex Adventure.
[img_thumb]http://i.imgur.com/uGETM5Z.jpg[/img_thumb]
[img_thumb]http://i.imgur.com/B7KsycK.jpg[/img_thumb]
The starting village/forest (maybe just a forest, idk yet?) name "Allorova" is a play on the word allocate, as a part of memory management in software development, where a player first spawns as they're "allocated" into the world.
I want the nearby town to be a play on the word "stack" or something of that sort. Like, "Stakkerth" or "Staksey." I'm not sure yet. I just know I want a dirt road to guide the player there, and a fork in the road that has a sign or something cool like that. Because I think that's cool and stuff.
I think I should finish up a dev tileset so I can layout the towns and stuff and come back to them and refine them over time.
[QUOTE=andrewmcwatters;47514095]I want the nearby town to be a play on the word "stack" or something of that sort. Like, "Stakkerth" or "Staksey." I'm not sure yet. I just know I want a dirt road to guide the player there, and a fork in the road that has a sign or something cool like that. Because I think that's cool and stuff.[/QUOTE]
Stackholm
Reminds me too much of stockholm. I don't know if that's a bad thing, but I kinda wanna hedge new names of places into the minds of players rather than make mental associations with existing locations. I like the name, though.
[editline]12th April 2015[/editline]
Oh, I also wanna write compelling stories and characters that make people really want to play the game. I've only really experienced a couple games that made me feel for characters and locations, so that's pretty important I think when making this universe.
[QUOTE=geel9;47513538][url=https://gist.github.com/geel9/e5cabd67eb25fe9d7e1c]Here's my networked mutex implementation in PHP[/url]. It allows you to create a mutex that is shared across a single server or across a variable amount of servers, using memcached as its backing. It uses a custom MCache class I wrote but you can very easily drop in your own.[/QUOTE]
Would also really appreciate if someone would do a peer review of sorts for this code -- rather important that I identify any flaws. It broke about an hour ago but that's because the server became overloaded and script execution time outlived the lifetime specified in code -- which can be fixed by specifying a longer lifetime / infinite lifetime.
[QUOTE=andrewmcwatters;47514126]Reminds me too much of stockholm. I don't know if that's a bad thing, but I kinda wanna hedge new names of places into the minds of players rather than make mental associations with existing locations. I like the name, though.
[editline]12th April 2015[/editline]
Oh, I also wanna write compelling stories and characters that make people really want to play the game. I've only really experienced a couple games that made me feel for characters and locations, so that's pretty important I think when making this universe.[/QUOTE]
Could just call it Stacktown.
Stackton.
Stacklist?
[QUOTE=Ziks;47512589]Thanks! We're using a basic networking framework I've built on top of Lidgren, source is here:
[url]https://github.com/Metapyziks/SanAndreasUnity/tree/master/Assets/Scripts/Facepunch/Networking[/url][/QUOTE]
That's seriously impressive. What kind of overall approach have you taken to networking entities? Is there some kind of interpolation built into Lidgren?
[QUOTE=BackwardSpy;47514228]Stackton.[/QUOTE]
I thought about something like Staktonn, I'll keep mulling it over. I want a village pub & inn, and a supplies store maybe. A drunkard, the innkeeper, and some third NPC. VA originally had preachers that served as a contribution to a faith attribute system that decreased probability that you'd be harmed, or cursed or something, but I'm not sure how I feel about introducing religion into VA.
I think it would end up weird like Runescape's various Gods that explain their universe, or the essentially worthless nines of the Elder Scrolls series.
The underlying B-plot to Vertex Adventure is that you exist in a sort of glitchy plane, where people state they've spotted the edge of the world that leads into this sort of inexplicable void much like what you've come from, and that strange phenomenon occur in the outlands. Like people teleporting and such. This is suppose to tie into the origins of magic in the world and a backstory that explains why witchcraft and sorcery exist.
Working on a hack for Dota 2. Currently seeing what kind of automation/exploitation is possible.
Got a last hit hack working well for most heroes, and a crit hack that works for all heroes with a crit ability. It cancels the animation once an animation event is received from the server if the animation isn't a crit.
The last hit hack will also take into account crit damage for the killing blow, so last hits are really easy for crit heroes. That's why it cancels it even when it should crit, so it can get the last hit properly. I'll be making it take into account Quelling Blade in the future too for even easier last hits.
Crit hacking should in theory be possible without having a unique animation, as long as the client can somehow predict or already know what the seed is. I don't know if this is the case in Dota 2.
[video=youtube;cJZTbip3jCw]http://www.youtube.com/watch?v=cJZTbip3jCw[/video]
At the time I recorded this, there are some things I overlooked in the projectile calculation for units, so it didn't work too great when ranged units were attacking my target, or when the hero was ranged. I fixed that though, among many other fixes.
If anyone is curious for more details on how the last hit/crit hack works, check out the video description.
holy shit
[QUOTE=Fourier;47513141]well blackboard bold is more logical than double uppercase :v:[/QUOTE]
Double uppercase is for when you need to yell at people extra-loudly online.
[IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG][IMG]http://upload.wikimedia.org/math/5/3/c/53cebcf80da7c3187d41d2a1ec7ac9d2.png[/IMG]!!!
[QUOTE=KaPow!;47508761]I wish I could use more than 16 colors but this doesn't look too bad tbh. Thats a 16 color greyscale palette, it looks like this:
[IMG]http://i.imgur.com/2bEDQPJ.png[/IMG]
The lightning doesn't look bad but textures AND lightning is pretty much impossible with just 16 colors. Well not impossible, but it just would look pretty bad.[/QUOTE]
I just saw [url=https://twitter.com/t3xtm0de/status/587308009451290627]this on twitter[/url] and it made me think of your project. They use different characters for shading. Couldn't you do the same?
It might not look as good as what you've got, but I think the results would be interesting.
[QUOTE=jalb;47514670]I just saw [url=https://twitter.com/t3xtm0de/status/587308009451290627]this on twitter[/url] and it made me think of your project. They use different characters for shading. Couldn't you do the same?
It might not look as good as what you've got, but I think the results would be interesting.[/QUOTE]
I've considered that before, I've seen it done a few times, but never did it myself.
I think going with a filled char is better, while that kind of shading would allow me to have the 16 colors for the textures, it kind of degrades the quality of the meshes, the empty space between the chars sort of ruins the illusion of depth. Maybe with a smaller font it'd look better, but for now I'm going to keep the current way of drawing.
Anyway, here's point lights:
[vid]https://dl.dropboxusercontent.com/u/25639311/ShareX/2015/04/2015-04-13_02-50-13.mp4[/vid]
I'm not as advanced as you guys are, but seeing the things you make is incredible. On another note, just wrote a basic client/server chat room.
Server:
[lua]public class MultiThreadServer extends Application {
// Text area for displaying contents
private TextArea ta = new TextArea();
// Number a client
private int clientNo = 0;
//global message var
private String message;
//private String backup;
ArrayList<HandleAClient> list = new ArrayList<HandleAClient>();
@SuppressWarnings("resource")
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
// Create a scene and place it in the stage
Scene scene = new Scene(new ScrollPane(ta), 450, 200);
primaryStage.setTitle("MultiThreadServer"); // Set the stage title
primaryStage.setScene(scene); // Place the scene in the stage
primaryStage.show(); // Display the stage
new Thread( () -> {
try {
// Create a server socket
ServerSocket serverSocket = new ServerSocket(8000);
Platform.runLater( () -> {ta.appendText("MultiThreadServer started at "
+ new Date() + '\n');});
while (true) {
// Listen for a new connection request
Socket socket = serverSocket.accept();
// Increment clientNo
clientNo++;
Platform.runLater( () -> {
// Display the client number
ta.appendText("Starting thread for client " + clientNo +
" at " + new Date() + '\n');
// Find the client's host name, and IP address
InetAddress inetAddress = socket.getInetAddress();
ta.appendText("Client " + clientNo + "'s host name is "
+ inetAddress.getHostName() + "\n");
ta.appendText("Client " + clientNo + "'s IP Address is "
+ inetAddress.getHostAddress() + "\n");
});
// Create and start a new thread for the connection
HandleAClient foo = new HandleAClient(socket);
new Thread(foo).start();
list.add(foo);
}
}
catch(IOException ex) {
System.err.println(ex);
}
}).start();
}
// Define the thread class for handling new connection
class HandleAClient implements Runnable {
private Socket socket; // A connected socket
ObjectInputStream inputFromClient;
ObjectOutputStream outputToClient;
/** Construct a thread */
public HandleAClient(Socket socket) {
this.socket = socket;
}
/** Run a thread */
public void run() {
try {
// Create data input and output streams
inputFromClient = new ObjectInputStream(socket.getInputStream());
outputToClient = new ObjectOutputStream(socket.getOutputStream());
// Continuously serve the client
while (true) {
// Receive message from the client
try {
message = (String) inputFromClient.readObject();
Platform.runLater(() -> {
ta.appendText("Message received from client number " +
clientNo + ": " + message +'\n');
});
System.out.println("Printing to all clients");
//Print to all connected clients
Platform.runLater(() -> { //stupid platform.runlater. so much code bloat
for(int i = 0; i < list.size(); i++){
HandleAClient temp = list.get(i);
ta.appendText("Sending to client number " + (i+1) + '\n'); // list clients sent too
try {
temp.outputToClient.writeObject(message);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
catch(IOException ex) {
ex.printStackTrace();
}
}
}
public static void main(String[] args) {
launch(args);
}
}[/lua]
Client:
[lua]public class ChatRoomController implements Initializable{
@FXML
TextField tfMessage, tfUserName;
@FXML
TextArea taChat;
@FXML
Button btnSend, btnAccept;
ObjectOutputStream toServer;
ObjectInputStream isFromServer;
String userName;
String chat;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
// TODO Auto-generated method stub
try{
//create a socket to connect to server
@SuppressWarnings("resource")
Socket connectToServer = new Socket("localhost", 8000);
toServer = new ObjectOutputStream(connectToServer.getOutputStream());
toServer.flush();
isFromServer = new ObjectInputStream(connectToServer.getInputStream());
taChat.appendText("Connected, please set a username!" + '\n');
}
catch(IOException ex){
taChat.appendText(ex.toString() + '\n');
}
btnSend.setOnAction(e-> connectToServer());
//String userName = tfUserName.getText().toString();
//constantly search for messages
Thread messageHandling = new Thread() {
public void run(){
while(true){
try {
chat = (String) isFromServer.readObject();
System.out.println("Message recieved");
taChat.appendText(chat + '\n');
}
catch (ClassNotFoundException | IOException e) {
e.printStackTrace();
}
}
}
};
messageHandling.start();
}
public void connectToServer(){
try{
//grab username and message to send
String message = userName + ": " + tfMessage.getText().toString();
toServer.writeObject(message);
toServer.flush(); // clear path
tfMessage.clear(); // clear user input area
}
catch(IOException ex){
System.err.println(ex);
}
}
}[/lua]
[img]http://i.imgur.com/TXPL9L5.png[/img]
Working on a multiplayer game inspired by World of Warships.
[video=youtube;roKbO7t5M8g]http://www.youtube.com/watch?v=roKbO7t5M8g[/video]
Definitely still in a very early alpha. I need to fix a lot of things but its been fun making and playing it.
[t]http://i.imgur.com/iGyBPQ5.png[/t]
My bot was too fast. Freerice blocked me. :(
[b]Edit:[/b]
Also, my bot is auto learning the answers.
So, each good answer are stored in the "white list" array and each bad answer are stored in the "black list". When it doesn't find the answer in the white list, it search on [url]http://dictionary.reference.com/browse/[/url] for a containing word that isn't in the black list. If nothing found, chose one randomly.
I went to church tonight and two of the boys around the age of target demographic for Vertex Adventure there were really interested in VA when I told them why I carried around a pocket notebook. Remember that picture of my notebooks above?
[img_thumb]http://i.imgur.com/uGETM5Z.jpg[/img_thumb]
One brother took my Apprentice and my drafting pencil and extended the map. I thought it was cute. They also liked the idea of world gates, and the younger brother created a world gate in the town over. I guess they interpreted them as spawnpoints. Maybe that's what they'll be. I dunno yet.
I was thinking about using their sketches and refining them to be actual extensions of nearby towns. I was proud of their sketches and told them I enjoyed what they shared with me. The older brother tried to use some child-drawn iconography to explain what he thought should go where on the map. That's what the symbols are more or less in the pictures below. He had never seen a drafting pencil before and told me it felt a lot like a pen.
[img_thumb]http://i.imgur.com/D8GYGwq.jpg[/img_thumb]
[img_thumb]http://i.imgur.com/esXuuQM.jpg[/img_thumb]
It's definitely not a technical post, nor is it the most artistic, but that was my night, and I thought I'd share these with you guys.
I made an algorithm for searching through products and I'm unsure if it's already known by some name.
Basically you take a search query and split it into its individual words. You then assign a point-value to each search term based on their position.
EG, "strange demoman weapon" becomes [strange,demoman,weapon] and their point values are [3,2,1] respectively.
You then search through the SKUs you have in stock and compare their search-strings (basically just a concatenated string of all their keywords, name, etc.). For each search term that appears in the product's name, you award that SKU that search term's amount of points.
Then you take the max pointvalue that any SKU can have -- in this case, it's 6 (3 + 2 + 1) and divide by 1.5 -- a completely arbitrary, made up number. This is the MINIMUM pointvalue that any SKU must have to be a "search result". In this case, an SKU must have 4 points minimum.
You then sort by pointvalue descending and display.
I've been messing around some more with stocks. I think I'm getting the hang of it - and I'm getting some excellent returns on dry-runs/backtesting data:
[IMG]https://dl.dropboxusercontent.com/u/10518681/Screenshots/2015-04-13_04-22-19.png[/IMG]
Send me your money, I'll get you returns of almost -1000%!
[sp]There was a bug in my trading algorithm that meant that it simply bought more of the stock if the price of the stock went up yesterday, regardless of the money available to invest[/sp] v:v:v
Anyway, I've ordered a book on all this stuff, it's really fascinating!
What platform do you use for your backtesting, and where do you get your tick data?
[QUOTE=KaPow!;47515184]I've considered that before, I've seen it done a few times, but never did it myself.
I think going with a filled char is better, while that kind of shading would allow me to have the 16 colors for the textures, it kind of degrades the quality of the meshes, the empty space between the chars sort of ruins the illusion of depth. Maybe with a smaller font it'd look better, but for now I'm going to keep the current way of drawing.
Anyway, here's point lights:
[/QUOTE]
There is something unbelievably satisfying about this. I can't really say what exactly.
[editline]13th April 2015[/editline]
[QUOTE=geel9;47515707]I made an algorithm for searching through products and I'm unsure if it's already known by some name.
Basically you take a search query and split it into its individual words. You then assign a point-value to each search term based on their position.
EG, "strange demoman weapon" becomes [strange,demoman,weapon] and their point values are [3,2,1] respectively.
You then search through the SKUs you have in stock and compare their search-strings (basically just a concatenated string of all their keywords, name, etc.). For each search term that appears in the product's name, you award that SKU that search term's amount of points.
Then you take the max pointvalue that any SKU can have -- in this case, it's 6 (3 + 2 + 1) and divide by 1.5 -- a completely arbitrary, made up number. This is the MINIMUM pointvalue that any SKU must have to be a "search result". In this case, an SKU must have 4 points minimum.
You then sort by pointvalue descending and display.[/QUOTE]
That's more or less the principle how search engines work. You assign scores to potential matches and then sort them by it.
However, I don't think position-based weights are the best idea. When I search for something I usually expect the order not to matter (unless it's some common combination of words, in which case I expect it to be treated as a single term). What I would expect is that the word "weapon" carries less weight than something more specific.
[editline]13th April 2015[/editline]
I don't play TF and know nothing about weapon trading, but I suspect that it's much more important to the user that the weapon is for the demoman class, than some other attribute is. He/she probably doesn't care for weapons that aren't their class.
So I made something which I'm assuming would be called a static map. It works like an std::map (almost), but has the speed of an std::array. The only downside is that it only works for integral types. The upside is that that includes enums!
So now I can map those weirdly numbered enums without some funky translation function. Here's an example:
[cpp]
enum my_weird_enum : int
{
alpha = 203,
beta = 234,
gamma = 400,
delta = 720
};
int main()
{
auto map = static_map<my_weird_enum, std::string,
alpha, beta, gamma, delta>({ "alpha", "beta", "gamma", "delta"});
std::cout << map.get<gamma>() << std::endl;
return 0;
}
[/cpp]
The get function basically maps the my_weird_enum to an index in the underlying std::array, using the last 4 parameters passed to the static_map constructor.
Here's what the get function looks like:
[cpp]
template<Index Idx>
Value &get() {
return my_array[index<Idx, Indices...>::value];
}
[/cpp]
This means that at compile-time, the compiler will see map.get<gamma>, look 'gamma' up in the list (it happens to be number 3), and says "Oh he means 2", and replace the index<> bit with 2, meaning no run-time overhead, and pretty much free mapping of Integral -> Whatever types.
The rest of the code including the static_map and index can be found here (it's less than 30 lines): [url]https://gist.github.com/MathiasPius/ead6f0f308fda1b257d5[/url]
[QUOTE=Dr Magnusson;47516974]So I made something which I'm assuming would be called a static map. It works like an std::map (almost), but has the speed of an std::array. The only downside is that it only works for integral types. The upside is that that includes enums!
So now I can map those weirdly numbered enums without some funky translation function. Here's an example:
[cpp]
enum my_weird_enum : int
{
alpha = 203,
beta = 234,
gamma = 400,
delta = 720
};
int main()
{
auto map = static_map<my_weird_enum, std::string,
alpha, beta, gamma, delta>({ "alpha", "beta", "gamma", "delta"});
std::cout << map.get<gamma>() << std::endl;
return 0;
}
[/cpp]
The get function basically maps the my_weird_enum to an index in the underlying std::array, using the last 4 parameters passed to the static_map constructor.
Here's what the get function looks like:
[cpp]
template<Index Idx>
Value &get() {
return my_array[index<Idx, Indices...>::value];
}
[/cpp]
This means that at compile-time, the compiler will see map.get<gamma>, look 'gamma' up in the list (it happens to be number 3), and says "Oh he means 2", and replace the index<> bit with 2, meaning no run-time overhead, and pretty much free mapping of Integral -> Whatever types.
The rest of the code including the static_map and index can be found here (it's less than 30 lines): [url]https://gist.github.com/MathiasPius/ead6f0f308fda1b257d5[/url][/QUOTE]
But isn't this exactly like having variables named alpha, beta, gamma and delta?
I mean, variable name lookup table is a static map.
[QUOTE=andrewmcwatters;47516257]What platform do you use for your backtesting, and where do you get your tick data?[/QUOTE]
I used to just use Yahoo Finance, they have a simple GET API to just grab CSV data from them. I was looking to move to a more sophisticated platform and stumbled across this:
[url]https://www.quantopian.com/[/url]
That's what I've been trying out recently, and that's what's in the image above.
It's nice but the online IDE is annoying and overall the platform is quite restrictive, so I'm seeking to emulate their environment locally so I can have a bit more flexibility (and use my own editor)
[QUOTE=Darwin226;47517203]But isn't this exactly like having variables named alpha, beta, gamma and delta?
I mean, variable name lookup table is a static map.[/QUOTE]
It actually pretty much is, but this way you can pass them around easily. The alternative would be to have a struct or similar, for every static_map you'd want. This really is just a sort of variable collection, but done with templates so it's more write once, use everywhere type deal.
[B]edit:
[/B]I recently added a runtime lookup as well, in case you don't know what you want at compile-time. This is obviously slower than instant, which is what the other lookup takes, but it should still be much faster than a map, since there is no real search. This is of course only possible because static_maps have static size. The fun thing about it is that for some reason constexpr functions don't seem to get compiled as such on the latest Visual Studio compiler, from what I can tell, even though the expression is entirely constexpr-able. There's a pretty good chance that the run-time lookup is instant on other compilers.
Sorry, you need to Log In to post a reply to this thread.