Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 7 8 [9] 10 11 ... 91

Author Topic: Programming Help Thread (For Dummies)  (Read 99343 times)

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #120 on: May 13, 2011, 08:37:43 am »

That's probably a badly compressed explanation.  and is this Programming Help Thread (For Dummies) any more? :)
I think they all left  :P
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

olemars

  • Bay Watcher
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #121 on: May 13, 2011, 08:47:31 am »

and is this Programming Help Thread (For Dummies) any more? :)

In 1988 this discussion would have been completely on topic.
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #122 on: May 13, 2011, 08:52:43 am »

Well, I am a "dummy" when it comes to programming in assembly, so I guess it still is. :P

e, ...Yeah, Intel's manual really is huge.
« Last Edit: May 13, 2011, 08:57:03 am by ILikePie »
Logged

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #123 on: May 13, 2011, 09:10:32 am »

and is this Programming Help Thread (For Dummies) any more? :)

In 1988 this discussion would have been completely on topic.

Actually assembly/machine is just as relevant today as it ever was. I'll ignore industry for a second and just point out one thing, how do you think all of the utilities for DF exist in the first place?
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Starver

  • Bay Watcher
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #124 on: May 13, 2011, 10:05:02 am »

!!Magma!! !!Magic!!

(Or was I right the first time? :) )
Logged

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #125 on: May 13, 2011, 11:02:26 am »

xna is not 'what you see is what you get', and as far as I understand there is no support for such a thing. I can't see how it would really benefit the framework for anything but menus, as the 'look' of your window should be defined by the objects it is displaying.

It's not the look I'm after, it's being able to capture text input in an event based manner. The way it's currently set, it's like you have to poll for every keystroke in the update method, compare it to oldkeystate etc etc, which is kinda backwards. I was hoping someone would know a better way to deal with it. I guess not.
Logged

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #126 on: May 13, 2011, 11:16:43 am »

I might have found the solution to my own problem. In case anyone's interested in the answer:
http://nuclexframework.codeplex.com/wikipage?title=Nuclex.UserInterface&ProjectName=nuclexframework
"The Nuclex.UserInterface library provides everything you need to add interactive graphical user interfaces to your game. It features a flexible scaling and positioning system, easy management of multiple states (so you could use a GUI for your game's menus and another GUI for an in-game computer display) and a decoupled rendering system. The latter allows you to write your own renderers, but the built-in default renderer already has support for skins defined by an easy-to-understand XML format."
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #127 on: May 13, 2011, 02:07:35 pm »

Think of it this way.  A single byte that is an opcode can possibly define only 256 different operations (maximum).  The parameters to those opcodes could be absolute values, references to memory locations, references to registers, etc...  Not counting that these absolutes/referenced-tos could be byte-sized, word-sized, etc...

One way this could be done is to make the parameters do some work to by saying "this parameter is an absolute/reference-to-absolute/reference-to-register/etc, of size byte/word/double-word/etc", and that's what the assembler tends to do (straight values, something like "@loc" and keyword references such as "eax", depending on the particular assembler).  But in machine code on all but the simplest chips (that might have only <=256 instruction forms anyway[1]) from the early days you work with multi-byte opcodes which gives the microcode part of the chip the expectation that this to be a move into a register of an absolute value, or of a value from another register, or of a specific memory location... each of these by a different opcode, and many more available, despite being "mov <foo>, <bar>" in the 'human readable' assembler.

That's probably a badly compressed explanation.  and is this Programming Help Thread (For Dummies) any more? :)



[1] I think I already mentioned that I have a conceptual language which needs just four different instructions.  Even at the binary level, it's just two bits.  (All params are references, no need to differentiate any further.)  However, this isn't a 'real' chip's internal language, that I'm aware. :)
a.) any 8-bit microprocessor is going to have less then 256 opcodes. Those are the kinds of chips you'd find in a remote controlled car or something.
b.) most instruction set use blocking, meaning for example for a 16-bit instruction set there are the following types of opcodes:
8*[4-bit instruction][12-bit address]
7*[4-bit instruction]3*[4 bit address]
8*[8-bit instruction]2*[4-bit address]
Et cetera.

and is this Programming Help Thread (For Dummies) any more? :) 

In 1988 this discussion would have been completely on topic.

Actually assembly/machine is just as relevant today as it ever was. I'll ignore industry for a second and just point out one thing, how do you think all of the utilities for DF exist in the first place?
I don't think anyone actually wrote anything in raw binary for them though. There are such things as disassemblers who'll turn the opcodes into readable instructions you know ;)
« Last Edit: May 13, 2011, 02:19:02 pm by Virex »
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #128 on: May 13, 2011, 02:09:40 pm »

That's probably a badly compressed explanation.  and is this Programming Help Thread (For Dummies) any more? :)
I think they all left  :P

No, I'm still here, I just haven't started a new project or class yet.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Normandy

  • Bay Watcher
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #129 on: May 13, 2011, 08:30:14 pm »

I'm kind of lost. Say I want to create a top-down hardware accelerated shooter with vector graphics. Exactly what do I need?

I'm comfortable working with 2d raster images (i.e. Graphics2D in Java, SDL, etc...), and I have the background in mathematics to handle basic vector graphics. I'm assuming that I will need some sort of library that exposes OpenGL/DirectX Shader API to the language I'm using, but other than that I'm not really sure how to approach this.

First off, is my assumption that 2d sprites are drawn as textures on rotated 3d quads correct?

Next, I'm plotting the parametric curve x=sin(t) y=2t+1 for t between [2,4]. Do I render the equation directly to the screen on top of everything else? Or do I rasterize it to a 2d surface first, then apply the surface as a texture on a 3d quad? Or do I create a bunch of vertexes at points along the curve then draw the mesh between the vertexes?

Now say I want to draw a beam along the curve that's a few pixels wide that's a certain color gradient that I set from code or a config file. Do I render the gradient to a 2d surface then either draw the surface directly on the screen multiple times along the beam, or apply the surface as a texture on a 3d mesh that I distort to match the beam's path? Or something else entirely, like drawing the beam purely through shader language?
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #130 on: May 14, 2011, 03:35:46 am »

Have you tried librsvg? I've don't have any experience with it, but it's part of the GNOME project, and they love using vectors wherever they can.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #131 on: May 14, 2011, 06:46:38 am »

Why would you use quads for this? Most 2D libraries can handle it for you without anything 3D-related.
Logged

Normandy

  • Bay Watcher
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #132 on: May 14, 2011, 08:54:22 am »

Well, 2D library is a pretty generic term. 2D can refer to something like SDL which deals purely with raster 2d surfaces, or it can refer to HGE which (I assume) textures 2d surfaces to 3d quads then hands them to the graphics driver (DirectX?) to render. I'm not sure A) if this assumption is correct or B) if there are any actual "hardware acceleration" benefits derived from the latter. Thus, I'm not sure if I should simply stick with SDL, or if I should seek out a 2D library that does things in 3D space "behind the scenes", or if I should stick purely with 3D (i.e. use a 3D rendering engine with some sort of pre-built billboard class), or if none if that matters at all and they're all just different ways of describing the same basic hardware routines.
« Last Edit: May 14, 2011, 08:57:18 am by Normandy »
Logged

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #133 on: May 14, 2011, 09:04:29 am »

Anything like SDL is going to use opengl "behind the scenes" if it can. Even Java and QT use opengl to draw 2d graphics. (Btw, you should consider using QT. It has a wicked fast 2d graphics library.)

Whats sad is, you could almost use geometry shaders to draw vector graphics...

Spoiler (click to show/hide)

I have a feeling it would be slower than sdl, geometry shaders have done nothing but disappoint me in all my use so far :P
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Normandy

  • Bay Watcher
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #134 on: May 14, 2011, 09:54:07 pm »

Example of what I'm going for:
Spoiler (click to show/hide)

I put this together with LWJGL (i.e. OpenGL). Imagine this, except with more glows. Do you think I'm approaching this the right way through LWJGL?
Logged
Pages: 1 ... 7 8 [9] 10 11 ... 91