This forum is in permanent archive mode. Our new active community can be found here.

Weekend coding

1679111239

Comments

  • My weekend coding consists of getting three rails projects to work with a gem that used spring 3.0.1 and should now use 3.0.5. The 3 rails projects all use different versions of the in-house gem.
    Also, trying to recover from upgrading virtual box to 4.0.10. Now I can no longer use my oracle instance running on a virtual linux box.
    So very complicated.
  • Even only knowing what half of those are, that sounds like a mighty clusterfuck you've got there.
  • I'm getting the impression that I too only know what half those things are.
  • Not doing your homework for you.
    It's the summer, I have no homework. I have only a project that would be a pain to do by hand that could be done pretty easily by a computer.
  • Boolean statements are your best friends.
  • edited August 2011
    This afternoon I came up with a new game idea. Without going into it too much, I'd thought I'd post some screenshots of procedural island generation. I image
    image
    Work in Progress shot. I mainly posted this because I thought it looked quite nifty.
    image
    Post edited by Andrew on
  • edited August 2011
    Forward to 3:25 if you don't appreciate good music.
    Post edited by Omnutia on
  • Computer, ENHANCE!
    image

    Now have a basic camera which can move around the island (which is now larger than the screen itself). Also testing printing characters over the sub-cell resolution used for the map.
  • Are you making Battle Royale the Rogue-like? Or perhaps Most Dangerous Game Rogue-like?
  • edited August 2011
    Are you making Battle Royale the Rogue-like? Or perhaps Most Dangerous Game Rogue-like?
    You'll have to do better than that Messieur Scaramanga.
    image

    I'm planning on getting something like a video game version of this board game (a favorite of mine, but also totally underrated).
    Post edited by Andrew on
  • While it looks really cool in general, I like the 'Hello World' in particular.
  • I've heard of that game. Always wanted to play it.
  • I've heard of that game. Always wanted to play it.
    The problem is that it lasts way to long (especially if there are lots of coups). I think it would work better in video game form where you can regulate the speed of certain actions while also adding more depth to certain aspects.
  • Change of plans. Thinking of making a real time advance wars type game. Scott, I know you are opinionated about what a strategy game should be, suggestions?
  • Change of plans. Thinking of making a real time advance wars type game. Scott, I know you are opinionated about what a strategy game should be, suggestions?
    Real-time advance wars? The key is to make it so that decision making, and not quick or accurate clicking, is the skill being tested.
  • Added basic unit class, land types during map generation, and mouse sensitive context for hovering over units and getting their names.
    image

    I had to get rid of the subcell rendering for land due to it's nature being unacceptable for gameplay issues.
  • Oh shits, what'd up unit information screen and path planning? Units are selected with a left button click and are ordered to move with a right button click. They lose focus if you click on an empty square. The current unit (battleship) only travels on deep sea tiles and cannot formulate a path through land/shallow water tiles.
    image
  • edited August 2011
    Thinking of making a real time advance wars type game.
    Have you seen combat mode in Advance Wars: Dual Strike? You control movement with the dpad and either shoot with the a button or use the stylus to shoot in any direction. Wasn't great, but it provided a fun little side game to play.
    Post edited by Dkong on
  • I was arguing with a friend about if primes tend to have more odd digits than evens, so I wrote some C++ code to test it. I mentioned this to a professor I was talking to who suggested I have it determine the most common even:odd ratios within numbers (5003, .50; 2423, .25; 499, .75). I plan to do so this weekend. It may not be much, but it certainly makes me happy.
  • edited October 2011
    I was arguing with a friend about if primes tend to have more odd digits than evens, so I wrote some C++ code to test it. I mentioned this to a professor I was talking to who suggested I have it determine the most common even:odd ratios within numbers (5003, .50; 2423, .25; 499, .75). I plan to do so this weekend. It may not be much, but it certainly makes me happy.
    Interesting problem.
    Small primes obviously have proportionally more odd digits because the last digit is always odd with the exception of the number 2. However, my guess is that as you consider larger and larger primes, you start to get roughly equal numbers of even/odd digits.

    Also, you can't really look at it in terms of "most common" ratios; you want to think about the mean ratio across either all prime numbers or all digits of all prime numbers (though making these concepts well-defined would take a little more effort, since you're looking at infinite data sets).
    Post edited by lackofcheese on
  • edited November 2011
    I have to do a creative project on Hamlet for English class. At first I was going to whip up a quick webpage, but now that my senior research paper is done, I don't have that much more to do, so I might as well make something cool. The plan is to make a text adventure. The problem is that even though our 11-page research paper was due today, the project is due Wednesday. So, is it reasonably possible to learn how and make a text adventure by then, keeping in mind the long weekend? What guides would you recommend? Any advice or pre-made parsers I can use/adapt? Many thanks in advance.

    EDIT: Also, what scenes do you think would work well?
    Post edited by Ikatono on
  • edited November 2011
    A bs text based adventure could easily be done in a sitting if you're familiar with a language (The widely revered book Learn Python the Hard Way actually uses a text adventure as its primary example). The rest is based on what system you want to use (Choose your own adventure? Action-Noun? RPG-esque), what features you want to implement (Branching paths? An inventory?), and how much you want the story to be fleshed out.

    As for scenes, a "Be Mean to Ophelia" simulator could be awesome. Or, you could release DLC telling just what happened during the three days when Adam Hamlet was on that cargo ship from Heng Sha to Singapore Denmark to England.

    Let me know if I can be of some advice.
    Post edited by Schnevets on
  • edited November 2011
    I made a little python script to check eztv for shows I'm waiting on. The trouble is both I and eztv have somewhat shoddy connections. I'd like urllib.urlopen() to keep trying until it can connect, but instead it times out and crashes the program. I tried to solve this by using a try-except that retries when it catches the exception, but I realized that if it fails a second time, the program crashes once again. For my current approach to work, I'd have to add try-excepts within try-excepts many times over. Somehow I think there's a better way to do this. What do I do?

    Edit: It looks like urllib2 allows me to specify the timeout time. I guess I'll try that.
    Post edited by Pegu on
  • First of all, use an RSS feed instead, like this one or this one. You can also set up something like uTorrent to automatically download such torrents too.
  • Yeah, I guess I kinda tried to reinvent the wheel.
  • edited December 2011
    Well, I decided to revisit an old Unity game I did some time ago.

    Does anyone like turn-based games?
    If you do, read on. Otherwise, ignore this:

    image

    Gameplay
    Put simply, the mission is to destroy the other player's units.

    R.O.E.
    You can only attack enemies that are tagged (the circle around the enemy unit shows this). This prevents you from raping one enemy unit time-and-time again. However, you can attack the same enemy numerous times if you have a Tag item or use a special attack. However, an enemy unit can resist this by acquiring the Untaggable status.

    Secondly, each player has a random unit selected as the Commander. If the commander dies, you will be unable to purchase items, status and actions. Keeping the identity of your commander hidden is for the best.

    Special Attacks require AP (Action Points)
    Action points are given for units that wait out a round, leaving themselves vulnerable. There are rules to waiting out rounds such as:
    1) The same unit cannot wait out consecutive rounds
    2) No more than half the team can wait out a particular round

    Items, Status, Skills and Actions require CP (Commander Points)
    Commander points are given to player after each round.
    If the Commander is destroyed, then you lose your commander turn at the end of each round.

    SP is Shield Points
    HP is Hull Points

    After a shield is destroyed, it cannot be recharged.

    The starting layout of your units is:
    Beam Beam
    Ballistic Flux Ballistic

    All units start with an initial item or 2, that can be used on itself or an ally.
    Beam Tank: 1 Shield batter y
    Ballistic Tank: 1 Repair Bot
    Flux Tank: 1 Shield battery and Repair Bot

    Weapons:
    There are 3 weapon firing modes. These do as you'd expect.
    1) Normal
    2) Critical
    3) Special

    There are 3 types of weapons:
    Beam
    These do more damage to shields and reduced damage to hull.
    SPECIAL: 50% chance to disable enemy unit shield, without tagging it out

    Ballistic
    These do more damage to hull and reduced dmage to shields.
    SPECIAL: 50% chance to dialbe an enemy unit, and prevent it from acting during the current round.

    Flux
    These do the same damage to shields and hull.
    SPECIAL: 2 consecutive shot. Either both miss or both hit.

    Items
    Items use the turn of the user.

    Tag
    Allow you to attack a unit more than once. You cant Tag an enemy then attack them with the same unit.

    Cursed Stone
    1 in 10 chance of killing an enemy unit instantly. Resurrection is still possible after this.

    Recycle
    Disposes one allied unit to gain 50% HP/SP from another. Resurrection impossible after this.

    Resurrection
    Allows you to revice an allied unit once (as long as it wasn't recycled).


    Skills
    Farsight
    +20 accuracy

    Cloak
    +25 evasion

    Double Damage
    x2 Damage

    Iron Curtain
    x2 Defence


    Actions
    Recharge
    +10 SP to a allied unit

    CP -> AP
    Converts 2 CP to 1 AP


    Status
    Untaggable
    This prevent a unit from being Tagged in the next round

    So that's it. It's more fun playing with another person, the AI is meh (since I wrote it). I was thinking of uploading the project, but it needs comments and tonnes of fixes. When I created this, multiplayer was farthest from my mind. As such, RPC called were just stuff in at a later point in time and look ugly. On top of that, replication needs to be better, instead of switching on ints. Maybe deserialize and pass stuff as JSON strings (you cant pass all object types via RPCs) and use dynamic invocation. Though the Invoke(), method calls CoRoutines (temporal functions) and I'm not sure how I'd make the call synchronous, buts that in relation to the current design. I need to read up on AI programming and what "thinking" approaches are efficient in my current situation. The current code is merely a clusterfuck of Random.value and if statements. Still I did enjoy this, and had some fun matches with my brother. Lemme know what you think, or don't think if this isn't your thing.
    Post edited by Xiphias3 on
  • I have a question about recursion in Python. How do you change the value of a variable on, say, the 5th level of recursion, so that it won't affect the same value on the 3rd (this variable is being passed to each new level, if it matters).


    I have a list called set and a function foo(set). foo(set) is a recursive function that returns the total of all recursions under it. Say set is [1, 2, 3]. foo(set):
    • add next value to set ([1, 2, 3, 4])
    • add foo(set) to total
    • add 1 to the last value in set ([1, 2, 3, 5]), then add foo(set) to total, while the last value of set is under a certain value
    • return the total
    Unless set has a length of 6, in which case it runs test(set) and returns either 0 or 1.

    What the program should end up doing is test every possible set with a length of 6 and find the total number of sets that meet a certain condition (test(set)). What ends up happening is that the program runs fine initially, but when lower recursions end, higher recursions are using the set from lower ones. So once it's run foo([1, 2, 3, 4, 5, 9]), instead of running foo([1, 2, 3, 4, 6]) it runs foo([1, 2, 3, 4, 5, 7]).

    How do I make each instance of set stop applying to lower recursions?

    Here's my code, if it helps:
    def setmake(set):
    total = 0
    if len(set) < 6:
    if len(set) == 0:
    set = [1]
    else:
    set += [set[-1] + 1]
    while set[-1] <= 3 + len(set):
    total += setmake(set)
    set[-1] += 1
    elif len(set) == 6:
    total += test(set)
    return total
  • Don't call lists set. Set is another type in python and it's very confusing to call a list set.
  • edited December 2011
    Yeah, set is a special word. Never use a special word in a non-special way. Like, you wouldn't do int printf = 5;
    Post edited by Apreche on
  • Ahh, didn't realize it was a reserve word. Still, that shouldn't be causing the problem in this case, right?
Sign In or Register to comment.