+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 20 of 80
  1. #1
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    people who code for fun (and profit?)

    bored out of my skull while at work manually calculating the right offsets to draw the UI for a minesweeper clone I decided to make (literally, it's a clone of minesweeper that I'm building just to teach myself/practice coding) and I thought, hey, there must be other BGers who code for fun and understand the love/hate/suffering/joy of it all!


    what are you guys working on? I recently started using libgdx and it opened up a whole new world of coding for me; it's amazing how big of a difference simply being able to display graphics on screen makes as far as motivation goes. the stuff I'm working on now just feels more real, rather than the typical "sort this matrix ten different ways" shit you get in school.


    my next project will probably be cloning the FFVI battle system, but we'll see. I never really know what I want to work on until I start something new. the fun part of being a beginner is that literally anything I want to code is worth coding; I have so much to learn!

  2. #2

    Not coding right now, but learning the ins and outs of Campaign Cartographer. Haven't worked with CAD software before, and it's proven to be... interesting, as someone who's used Photoshop for 20 years.

    Before that, brushed up on my Ruby playing around in RPGMaker.

  3. #3
    Ridill
    Join Date
    Oct 2006
    Posts
    18,451
    BG Level
    9
    FFXIV Character
    Sath Fenrir
    FFXIV Server
    Cactuar
    FFXI Server
    Fenrir

    Learning Perl to operate a space telescope.

  4. #4
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    Quote Originally Posted by Talint View Post
    Not coding right now, but learning the ins and outs of Campaign Cartographer. Haven't worked with CAD software before, and it's proven to be... interesting, as someone who's used Photoshop for 20 years.

    Before that, brushed up on my Ruby playing around in RPGMaker.
    I really need to look into that. I never quite understood how to program for RPGMaker with Ruby, but then again I never researched it.


    maybe another day though. having too much fun with libgdx atm.

  5. #5

    Quote Originally Posted by Yuri-G View Post
    I really need to look into that. I never quite understood how to program for RPGMaker with Ruby, but then again I never researched it.


    maybe another day though. having too much fun with libgdx atm.
    It's pretty simple. There's a base library in the game, and you append scripts you write to the game itself, using inheritance calls and such.

    Or, you can go in and edit the base library files themselves. Which is fine for a solo-game environment that you might be working on. However, it's common practice to work using add-on scripts/inheritance so scripts can be shared between users.

    It's all Ruby based though, so you get familiar with syntax rules pretty quickly. Little more rigid than Python/Lua imo, but I can see why it's popular with Japanese development.

  6. #6
    wotg torrent kitty :3
    Join Date
    Jun 2007
    Posts
    1,643
    BG Level
    6

    Converted some 10years old web apps at work with the Yii PHP framework, about 2 years ago. Teached me a lot about OOP. Now upgrading them to Yii2, which brings a couple new things like using namespaces, composer etc. Also currently trying to create a desktop window running some tasks during domain logon, in Visual Studio using C# (totally new to it). We still got a batch script to cover some stuff which you can't do with GPOs. I just want to give our users a more professionally looking feedback than a cmd window.

    We don't have a dev department nor a dedicated programmer, so off-tasks like these are always a learning opportunity to me. If one turns out to be a bigger project, I can forward it to my boss to get it approved. Means it get's a priority rating from the executives and I can postpone other tasks if necessary. Otherwise it's just a whenever I got time thing.

  7. #7
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    Quote Originally Posted by Talint View Post
    It's pretty simple. There's a base library in the game, and you append scripts you write to the game itself, using inheritance calls and such.

    Or, you can go in and edit the base library files themselves. Which is fine for a solo-game environment that you might be working on. However, it's common practice to work using add-on scripts/inheritance so scripts can be shared between users.

    It's all Ruby based though, so you get familiar with syntax rules pretty quickly. Little more rigid than Python/Lua imo, but I can see why it's popular with Japanese development.
    Thanks for the info. I may look into that as my next project. I'm looking for things to work on that will teach me more about coding, but are also fun - a counterpoint to the dryness of what I do for school. Gotta remind myself why I'm passionate about this art form, you know?


    In related news, finished building the background in that minesweeper replica. Just need the smiley faces and the counters and we'll be set, aside from some debugging (currently, resizing the window makes java bitch about trying to access an array with index -15. shut up java, you whiny little bitch).

  8. #8
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    working on a new project and wondering if any of you have some thoughts on how I organize this? basically I'm building a little roguelike and I have two different ways of organizing the textures for each cell:


    1) maintain a matrix that has all the cells in the board. each cell will contain a reference to whichever background and foreground textures (if any) should be drawn there. accessing an empty cell - where no texture will be drawn (except the parallax background) - will inform the render method to ignore that cell and draw nothing. this is slightly wasteful of course; why access the cell at all if there's nothing to draw?


    2) maintain one copy of each texture, and attach it to a list of ordered pairs describing which cells should contain that texture. this is more efficient, because you never actually access the blank cells. it's a much less intuitive way of organizing the data, but it makes more sense from a computational perspective.


    I'm toying with both ideas. I'll probably go with number 1 because, let's face it, with the amount of processing power available to most devices the small cost in extra processing time is beyond negligible. maybe if I were writing an Atari game, but in the modern era the whole question is moot. also, the second method could lead to some confusion if the code were ever altered in the future, given that the texture data is separated from the representation of the board itself. makes more sense, if you're thinking as a human anyway, to attach the desired texture to each cell than the other way around.


    however, given that I'm just an aspiring coder who is playing around with stuff, I have no idea which approach would be favored stylistically and why. any thoughts are appreciated. mostly I just wanted to type this out to get a grasp on the idea myself, so if nobody has anything to say that's fine too this isn't really a coding forum after all. I'll probably post the same question elsewhere but feel free to chime in if you like!

  9. #9

    however, given that I'm just an aspiring coder who is playing around with stuff, I have no idea which approach would be favored stylistically and why.
    Background: Been programming for close to 30yrs.

    If the goal is human readable code #1, if the goal is machine readable code #2.

    Those are the only two concerns in regards to style, and the difficult part is deciding which is more important for a given program or code base.

  10. #10
    Falcom is better than SE. Change my mind.
    Join Date
    Jun 2006
    Posts
    17,291
    BG Level
    9

    Other than work (Been a developer for roughly 2.5 years) I haven't done much. I have been looking into a way to make a "snap" tile based game (think how you move in Chip's Challenge) but haven't noticed a good object yet to load an array of background tiles/the character

  11. #11
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    Quote Originally Posted by Darus Grey View Post
    Background: Been programming for close to 30yrs.

    If the goal is human readable code #1, if the goal is machine readable code #2.

    Those are the only two concerns in regards to style, and the difficult part is deciding which is more important for a given program or code base.
    that is really helpful information. thanks!


    I'm probably gonna go with #1 because it makes more sense for a small-scale personal project. I can always rewrite the code later in the very unlikely event that style #1 causes any problems. the point right now is to code anything and get practice, not be perfect.


    Quote Originally Posted by Corrderio View Post
    Other than work (Been a developer for roughly 2.5 years) I haven't done much. I have been looking into a way to make a "snap" tile based game (think how you move in Chip's Challenge) but haven't noticed a good object yet to load an array of background tiles/the character

    given that I'm working on a roguelike, which is somewhat similar - what kind of object do you mean exactly? I'm unclear on what you're asking for, but maybe I can help.

  12. #12
    Falcom is better than SE. Change my mind.
    Join Date
    Jun 2006
    Posts
    17,291
    BG Level
    9

    I suppose an image would be a better example. Taking Chip's Challenge as an example:



    I'm trying to figure out what the best way would be to replicate something similar in boxed area with a 9x9 grid of 32x32 px images and being able to move/refresh accordingly.

  13. #13
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    I... just wrote an entire, huge, long post about this.


    then the internet ate it.


    what you're asking is actually relevant to what I'm working on now; I'll share when I have a moment.


    just... not right now... because... *cry*

  14. #14
    Falcom is better than SE. Change my mind.
    Join Date
    Jun 2006
    Posts
    17,291
    BG Level
    9

    Take your time. I know that feel.

  15. #15
    Ridill
    Join Date
    Oct 2006
    Posts
    18,451
    BG Level
    9
    FFXIV Character
    Sath Fenrir
    FFXIV Server
    Cactuar
    FFXI Server
    Fenrir

    I fucking loved that game

  16. #16
    Falcom is better than SE. Change my mind.
    Join Date
    Jun 2006
    Posts
    17,291
    BG Level
    9

    Same. Glad the first and sequel (after 15+ years) are now on Steam.

  17. #17
    Bagel
    Join Date
    Jun 2008
    Posts
    1,254
    BG Level
    6
    FFXI Server
    Odin

    The Little Schemer series to brush up on Lisp for AI this semester.

  18. #18
    Campaign
    Join Date
    Feb 2010
    Posts
    6,995
    BG Level
    8
    FFXI Server
    Sylph

    I've been learning some .js for greasemonkey for firefox.

    I've learned I don't have a mind well suited for scripting.

    Trying to grind it out anyway.

  19. #19
    Falcom is better than SE. Change my mind.
    Join Date
    Jun 2006
    Posts
    17,291
    BG Level
    9

    I can relate. Coming from an OOP background to Javascript was a pain in the ass for me l. I have a book on it mu coworker suggested I need to crack open at some point

  20. #20
    Queen of the Pity Party
    Join Date
    Sep 2007
    Posts
    11,485
    BG Level
    9

    ok so I'm not sure where you are coming from - what framework (if any) you're using, how much you've already done, what you need exactly. so I'll give you what I can and if you have more questions just ask, or if I'm repeating what you already know then oh well I'm not going to go too in-depth or give you code examples because I don't want to give you info you already have and I don't know what language you're using, but feel free to ask for clarification.

    I use a framework/engine called libgdx. this allows me to upload a texture (just a jpg or png usually) and tell the computer where to display it (with the lower-left corner of the window being 0,0) and how to resize it.

    with that in mind, and using chip's challenge as the example:

    first, the background layer. I would use an array of textures, with each one being one of your basic background images. call this textureArray. for example, textureArray[0] might be a basic floor tile, textureArray[1] would be a wall, etc.I would make a separate array for any foreground textures - red key, flippers, chip, etc.

    I would then make a matrix (I just use a 2d array, not an actual matrix class). call this backgroundTiles. for each row/column I would put into that matrix the index of the background image I expect to use in that space. I would then display that using libgdx, multiplying the [row][column] in the matrix by 32 (to offset each square by 32 pixels * the number of rows/columns). basically your matrix, with each row/column multiplied by 32, would translate directly to the screen itself. this would look something like "for each cell in backgroundTiles, display textureArray[backgroundTiles[row][cell]] at x-offset = row * 32, y-offset = column * 32"

    note that this matrix can change. for example, you open a door with chip. when you do so, your code should alter the backgroundTiles at that row/column to a 0, so it's now displaying the basic floor tile.

    now for the foreground. you could do this a few different ways. I'll give you the one I would do.

    first, I would make another matrix and call it gameBoard. in your case this would be a 9x9 matrix. this would track any objects that are relevant to gameplay: player character, keys, chips, etc. each of those objects would have a separate index; walls might be 1, chip would probably be 2, red key might be 3, blue key might be 4, etc. any square that isn't currently occupied by an object would probably be 0.

    in the chip's challenge example, I would also track the location of chip separately, with a simple 2d vector (representing his coordinates in the matrix). why? because have a frequent need to access chip's location when a key is pressed. it makes no sense to search the entire matrix for this every time!

    additionally, I would track the location of every foreground object in a separate list. why? because when we display our foreground objects, the gameBoard matrix will probably contain mostly blank spaces at any given time, and we don't need to look at all those blank spaces just to know "Hey, don't display anything here." with the processing power of today's computers, you could run through the matrix like that - it would work fine - but it just is bad practice imo. as for what type of list I would use for that - a dictionary-type interface would work nicely. the "keys" in the dictionary would be the object type, the "values" would be a list of coordinates where you want to display that object type.

    so now you're ready to draw your images. first, run through every single cell in your backgroundTiles matrix and display them as I described above. this has to happen first, because otherwise you'll draw your background on top of your foreground. next, run through the dictionary of foreground objects. for each object in the dictionary, run through the associated list of coordinates, and display the relevant textures. obviously these have to have a transparent background; you don't want to display a red key with a big fat white square behind it.

    note: I'm not sure a dictionary is the best way to do this? you could even make your own container class that is more suited to such an operation. that's what I would do - but I'm really rusty on container classes in general. I'm sure there's something out there that would work well here, in any case.

    so now you've displayed your background, and then displayed your foreground on top of that. the last thing is input.

    when you get your keyboard input - however you do that, libgdx has its own built-in method - you would check if one of the four arrow keys was pressed. if so, grab the player's coordinates and check what's in the next square over based on that key press. if the player presses up, for example, check the gameBoard square above chip. is there a wall? do nothing, or maybe play a "bump" sound. is there a moveable square? then move there. does that square contain a red red key? add the key to chip's inventory and remove it from the gameBoard, and remove that coordinate from the list of coordinates for red keys so it won't display there anymore. one thing to keep in mind is that you will need to track whether chip is moving or not. if his state is "moving" then any key presses should be ignored. once he stops "moving," then key presses can be read again. how do you do this is up to you; probably just a simple boolean - when a key is pressed that moves chip onto a valid square, "moving" becomes true. once his moving animation is finished and he's in the new square, "moving" becomes false again.

    there's a lot more you could do. you could add enemies, of course. you could add an "attack" function to chip, which attacks the enemy in whichever direction chip is facing (of course, then you would need more sprites to show which way he's facing as well as tracking his direction with another variable." in any case, hopefully this helps?

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 2009-05-02, 20:45