Sub's coding pool party

Lost in space
Banned
Joined
Dec 30, 2012
Messages
133
Best answers
0
Location
Spain
All of them suck. Just kidding.



But why did you have to list every single program he made?
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
They were all made by me, the thread is titled the way it is to playfully mock Hlev. I posted them all because that's the purpose of the thread. It's all about shit I've made, and I've made all that shit.
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
I'm going to stop posting in this thread for a while, because I feel like I've been spamming it, but before I do, I want to proclaim victory. It took me roughly 30 hours to get this to work, but it finally does.







The code to make this bullshit happen
http://codepad.org/X9ZkggW3
http://codepad.org/1yXEv3ot
 
Last edited:
Member
✔️ HL Verified
🌟 Senior Member
Joined
Oct 16, 2006
Messages
379
Best answers
0
Location
the Netherlands
Is the FPS capped or did you do a bad job writing it? :)
 
Last edited:
Cunning as Zeus
Banned
✔️ HL Verified
💻 Oldtimer
Joined
Nov 23, 2003
Messages
6,079
Best answers
0
Seems to be capped as the older pics have fps in the 200s.
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
It's capped at 30. In debug mode I get about 200, release 1500 - 2000.

It should be one draw call per line segment, which is why it took me so long to write. If I had a separate draw call for every tile with a border, I could have wrote it in no time, but then it would have effected fps a bit. I do have to double check it to make sure it's actually doing what I think it is though.

It scans a list of tiles currently on the screen. If a tile is owned by someone and not surrounded by tiles owned by the same person on all its sides (bottomleft/bottomright/topleft/topright), then the sides which have have tiles not owned by the same person get labeled as such and the tie gets added to a list of tiles to add a border to. Once all the tiles on screen are labeled, it takes a tile from that list and starts a new line segment. starting from the bottomright of the tile and moving in a clockwise motion, it adds points to the linesegment. the clockwise motion stops when it runs into one side that doesn't need to have a line for that tile. It's checked for here if the has all of its sides drawn, and if so, the tile gets removed from the list of tiles to add borders. then it scans for neighbors that are owned by the same tile, starting to the left and again going in a clockwise motion, and when it finds one a valid tile it completes the same process as above. It stops when it finds a tile which doesnt need any of its sides completed, which is our cue to pick the first tile on the tiles to add border list and start this process again. Not sure if there's a better way to do it, but that seems pretty reasonable to me.
 
Last edited:

Eon

TeeHee
Banned
Joined
Dec 20, 2002
Messages
5,341
Best answers
0
Location
Dallas, TX
It's your own dev thread, spam the shit out of it. Although that could just be me being selfish because I just like watching things being developed. The process is fun to observe.
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
I made a really quick program tonight that is rather useless and I'm sure was totally unnecessary to create.

I've been playing a lot of Starcraft II lately, and when I play I usually stream the games because I like to see where I could have done better, and hey, why not. So I made a little virtual keyboard to go together with that -- it shows what keys I press while playing. Going to try to see if I can actually integrate it into SC2 a bit and maybe have it give me stats for games that I play, maybe a chart of apm over the course of the game or something. I have no idea how to do that though, so I don't have high hopes for it happening.

But yeah, behold the greatness that is the SubVirtualKeyboard -- http://www.twitch.tv/subacious/b/388119633
 
Last edited:
Death from Above
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 25, 2001
Messages
4,943
Best answers
0
Location
Get off my couch
That could really take off if you can make it work in games
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
Well, there's SC2 Gears, which has an utterly terrible interface but is great for analyzing games and is better than anything I could make.

There are also a billion virtual keyboards out there. I think one even comes shipped with Windows 7.
 
Death from Above
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 25, 2001
Messages
4,943
Best answers
0
Location
Get off my couch
None of them made by you

I've seen other keyboards and they're massive, Yours looks nice and tidy
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
Yeah, that's the main reason I made it. The other keyboards I tried couldn't be resized and they were too big, they would have blocked the build menu.
 
Member
✔️ HL Verified
Discord Member
Joined
Apr 7, 2013
Messages
621
Best answers
0
Location
No.
Hey, Sub, that keyboard is pretty sweet. :p
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
Thanks Horatio :)

I'm still working on the civ clone every now and then, but I'm going to be starting a new project for fun. I'm thinking of trying out a component based architecture rather than object oriented, but I'm not really sure where to start.
 

sub

Active Member
💻 Oldtimer
Joined
Jun 18, 2003
Messages
5,961
Best answers
0
Location
New York
Thanks for the kind words

Spent a lot of time reading today about various ways to go about this, and as of right now I'm going to be trying to replicate the system in this framework, described here in an extremely general sense and here in a more specific sense. I've never really liked the deep hierarchies in object oriented programming, hoping I'll like this more.
 
Last edited:
Member
✔️ HL Verified
🌟 Senior Member
Joined
Oct 16, 2006
Messages
379
Best answers
0
Location
the Netherlands
Thanks for the kind words

Spent a lot of time reading today about various ways to go about this, and as of right now I'm going to be trying to replicate the system in this framework, described here in an extremely general sense and here in a more specific sense. I've never really liked the deep hierarchies in object oriented programming, hoping I'll like this more.
Although it's not exactly like Artemis, Unity3D's pulls of the whole gameobject-component structure quite nicely. You might want to take a look how that works. Unity is free to download if you want to toy with it.
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
Thanks for the kind words

Spent a lot of time reading today about various ways to go about this, and as of right now I'm going to be trying to replicate the system in this framework, described here in an extremely general sense and here in a more specific sense. I've never really liked the deep hierarchies in object oriented programming, hoping I'll like this more.
Interesting stuff. I'd argue that deep hierarchies and 'milk that uncows itself / lists that sort themselves'-like code are symptoms of bad OO-design (e.g. using inheritance to solve every problem and violating the single responsibility principle) and that components and data oriented design are actually proper OO-methods for specific problems.

For example, a MovementSystem could process all entities with Position and Velocity components, and each frame it would update the values of each Position component given the associated Velocity component. A RenderSystem could process all entities with Position and RenderableMesh components, and it would draw each mesh to the screen given the values from the updated Position component. In neither case do the components require any knowledge of each other.
Sounds elegant, but the disadvantage is that this does not seem to be able to handle multi-threading. You can not have your physics system update the positions in one thread while the render system renders in another thread (reading the positions), 'cause the positions might be in a inconsistent state if the render thread reads them while the physics thread is still busy updating them. The whole thing sounds kinda like a blackboard system http://en.wikipedia.org/wiki/Blackboard_system to me; for that there is a lot of software for that that already solves thinks like multithreaded access.
 

Users who are viewing this thread

Top Bottom