I'm programming the board game Grind using Scratch. Yes I know scratch is for 8-year olds but it is the only one I know how to use.
[QUOTE=Dj-J3;25149243]Working on a text based crafting system, called TextCraft.
[img_thumb]http://i54.tinypic.com/vy8j2a.png[/img_thumb]
One of those "i'm bored" projects :v:[/QUOTE]
[img]http://i53.tinypic.com/2gv3d6q.png[/img]
Progress :v:
Can now search for materials. Time it takes to mine depends on what material is it that you've found, like in minecraft.
[QUOTE=layla;25156584][img_thumb]http://dl.dropbox.com/u/99765/fb89261.png[/img_thumb]
Working on screens atm for main menus and such.
Is this something anyone would be interested in playing just as an online building game? I have an idea for a proper game using it but I think It should just be a building game as a prototype.[/QUOTE]
Are you using Bresenham's line drawing algorithm to check which block you're looking at?
[QUOTE=Overv;25160745]Are you using Bresenham's line drawing algorithm to check which block you're looking at?[/QUOTE]
I've been working on this with layla, and I implmented the picking. To answer your question, no we don't use Bresenham's algorithm. To my knowledge (and I'd love to be wrong), Bresenham's line algorithm produces an output such as this:
[IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Bresenham.svg/500px-Bresenham.svg.png[/IMG]
Whereas for block/face picking, we require something such as this:
[IMG]http://i54.tinypic.com/21bvzx2.png[/IMG]
To do so, I have implemented my own algorithm. It's fairly trivial, I don't know if anyone named it, but basically it works out which is the nearest grid interval then advances to that point on the line, the direction of the advancement determines which face (top, left, etc.) was picked. Of course if there is a better algorithm, or Bresenham's algorithm can produce such output, please let me know.
Hate posting mini-updates, makes me feel spammy:
[media]http://www.youtube.com/watch?v=jttFQb6yjbY[/media]
I made tiles able to update themselves, State changing tiles :D
[QUOTE=Tezzanator92;25161983]Hate posting mini-updates, makes me feel spammy:
[media]http://www.youtube.com/watch?v=jttFQb6yjbY[/media]
I made tiles able to update themselves, State changing tiles :D[/QUOTE]
Sounded nice [i]until[/i] you put random tones on :v:
So true :v:, I think I need to add a way to "mask" what notes it can pick.
[QUOTE=Chandler;25158225]Progress on my language (small as it might be) :)
One of the things I enjoy with OOP based languages is overloading operators (WITHIN REASON), and it's a definite feature I want in mine. The problem arises however of effectively writing the same thing over and over. For instance in C++, a Vector3 might look like this:
[cpp]
vector3<T>& operator -(const vector3<T>& right)
{
return vector3<T>(this->x - right.x, this->y - right.y, this->z - right.z);
}
vector3<T>& operator +(const vector3<T>& right)
{
return vector3<T>(this->x + right.x, this->y + right.y, this->z + right.z);
}
vector3<T>& operator *(const vector3<T>& right)
{
return vector3<T>(this->x * right.x, this->y * right.y, this->z * right.z);
}
vector3<T>& operator /(const vector3<T>& right)
{
return vector3<T>(this->x / right.x, this->y / right.y, this->z / right.z);
}
vector3<T>& operator -(const T& value)
{
return vector3<T>(this->x - value, this->y - value, this->z - value);
}
vector3<T>& operator +(const T& value)
{
return vector3<T>(this->x + value, this->y + value, this->z + value);
}
vector3<T>& operator *(const T& value)
{
return vector3<T>(this->x * value, this->y * value, this->z * value);
}
vector3<T>& operator /(const T& value)
{
return vector3<T>(this->x / value, this->y / value, this->z * value);
}
[/cpp]
Quite tedious right?[/QUOTE]
I don't mean to take the spotlight away from your language, but just FYI, that structure already exists in C++. It's called a valarray, and I'm surprised so few people seem to know about it.
[QUOTE=thomasfn;25159205]But fraps brings my fps from 60-100 down to 1-2. Are there any other free non fps-raping video recorders out there?[/QUOTE]
You have to record to a separate hard drive.
[QUOTE=Tezzanator92;25161983]Hate posting mini-updates, makes me feel spammy[/QUOTE]
I think it's nice, I like scrolling through pages of talking and seeing cool visual stuff, really motivates me in a way talking about programming doesn't.
[QUOTE=Dj-J3;25160214][img_thumb]http://i53.tinypic.com/2gv3d6q.png[/img_thumb]
Progress :v:
Can now search for materials. Time it takes to mine depends on what material is it that you've found, like in minecraft.[/QUOTE]
[b]Saving[/b]
[img_thumb]http://i51.tinypic.com/2e1epw3.png[/img_thumb]
[b]Loading[/b]
[img_thumb]http://i55.tinypic.com/oaxhrr.png[/img_thumb]
Can now save and load games :v:
Your saving and loading system is very hackable, also try making the whole load scriptable if you have not already.
[QUOTE=Vbits;25163474]Your saving and loading system is very hackable, also try making the whole load scriptable if you have not already.[/QUOTE]
Yes, i know it's very hackable, i'm gonna do something about that later on. But thanks for giving CC.
Also, what do you mean by "making the whole load scriptable"?
[b]Quoting for new page[/b]
[quote=][b]Saving[/b]
[img_thumb]http://i51.tinypic.com/2e1epw3.png[/img_thumb]
[b]Loading[/b]
[img_thumb]http://i55.tinypic.com/oaxhrr.png[/img_thumb]
Can now save and load games :v:[/quote]
For a simpler sort of project i have made the object orientated side scriptable...
[code]
R|Spawn|Starting Entry Room
R|Testing1|Just a Testing Room
R|Testing2|Just another Testing Room
R|Testing3|Last Testing Room
L|Testing1|Testing2|enter door 1|enter door 1
L|Testing1|Testing3|enter door 2|enter door 1
L|Spawn|Testing1|enter door 1|enter door 3
E|Testing3|Testing|Hello, World:test
E|Spawn|Testing|Welcome:welcome
E|Spawn|Testing|This is a longer Test:test
[/code]
For your project I would recommend having objects not hard coded.
[QUOTE=layla;25157344]That's not source, I'm using source textures because I'm not an artist.
The idea is to have two teams work together to build their fort and then have them fight it out trying to destroy each others base.
But for the prototype It's just going be the building part of the game to see if people would be interested in playing a game like that.[/QUOTE]
Wow, that looks fantastic and sounds fun to play as well, great job.
[QUOTE=Dj-J3;25163451][b]Saving[/b]
[img_thumb]http://i51.tinypic.com/2e1epw3.png[/img_thumb]
[b]Loading[/b]
[img_thumb]http://i55.tinypic.com/oaxhrr.png[/img_thumb]
Can now save and load games :v:[/QUOTE]
Dude encrypt that shit, anyone could give themselves what they want!
Man, I never knew how coding wastes a lot of time :frown:
But the worst part is that I didn't get much done today. I've spent a few hours on trying to get bullets working correctly. You can shoot, but the problem is that they don't destroy when you shoot a wall. Very irritating :saddowns:
[QUOTE=Xeon06;25163749]Dude encrypt that shit, anyone could give themselves what they want![/QUOTE]
Yeah, i'm working on that, it's next on my todo list. :3:
[QUOTE=Dj-J3;25164212]Yeah, i'm working on that, it's next on my todo list. :3:[/QUOTE]
He was being sarcastic.
[QUOTE=Ortzinator;25164845]He was being sarcastic.[/QUOTE]
Think he knows that. 'tis a valid point regardless.
[QUOTE=Tezzanator92;25161983]Hate posting mini-updates, makes me feel spammy:
[URL="http://www.facepunch.com/#"]View YouTUBE video[/URL]
[URL]http://youtube.com/watch?v=jttFQb6yjbY[/URL]
I made tiles able to update themselves, State changing tiles :D[/QUOTE]
Wow thats awesome. Thats the first time i have seen your work thing.
Can you add your own sounds or is it only piano? Also will you release this once you are finished?
I added a new combat system to my game where the more you hit stuff the higher your 'combo' bar goes up and the higher it is the more damage you do and the cooler you look (start glowing and stuff).
[img]http://localhostr.com/files/7a14b8/cloudcombo.jpg[/img]
(too freaking hard to get a screenshot just as he's attacking D:)
You can die now too.
[img_thumb]http://localhostr.com/files/fc9600/clouddead.jpg[/img_thumb]
Might release a short demo in a couple of weeks or so with a few maps and quests.
I really like the art style, nice job.
'Mo progress! (Disclaimer: as usual, nothing is set in stone, so the format you are about to see may change!)
I'm currently working on the intermediate format (YAML). Taking my example vector3[T] class from earlier (with the operators removed), I hope to eventually generate this:
[code]
# math.vector3[T]
---
name: vector3
imports:
- math
declarations:
- type: namespace
name: math
members:
- type: class
name: vector3
generic: Yes
genericargs: [T]
members:
- type: constructor
args:
contents: 'self.x = self.y = self.z = 0'
- type: constructor
args:
- type: T
modifiers:
- const
- ref
name: value
contents: 'self.x = self.y = self.z = value'
- type: constructor
args:
- type: T
modifiers:
- const
- ref
name: x
- type: T
modifiers:
- const
- ref
name: y
- type: T
modifiers:
- const
- ref
name: z
contents: |
self.x = x
self.y = y
self.z = z
- type: constructor
args:
- type: vector3[T]
modifiers:
- const
- mov
name: move
contents: |
self.x = move.x
self.y = move.y
self.z = move.z
- type: constructor
args:
- type: vector3[T]
modifiers:
- const
- ref
name: copy
contents: |
self.x = copy.x
self.y = copy.y
self.z = copy.z
- type: method
name: all
args:
- type: T
modifiers:
- const
- ref
name: value
returns: none
contents: self.x = self.y = self.z = value
- type: method
name: one
args:
returns:
contents: self.x = self.y = self.z = cast[T](1)
- type: method
name: zero
args:
returns:
- type: property
name: x
contains:
- get:
- type: T
modifiers:
contents:
- set:
- type: T
modifiers:
contents:
- type: property
name: y
contains:
- get:
- type: T
modifiers:
contents:
- set:
- type: T
modifiers:
contents:
- type: property
name: z
contains:
- get:
- type: T
modifiers:
contents:
- set:
- type: T
modifiers:
contents:
- type: property
name: length
contains:
- get:
- type: T
modifiers:
- const
- ref
contents: sqrt(self.length_squared)
- type: property
name: length_squared
contains:
- get:
- type: T
modifiers:
- const
- ref
contents: (self.x * self.x) + (self.y * self.y) + (self.z * self.z)
...
[/code]
from this:
[code]import math
namespace math:
class vector3[T]:
/* constructors */
def new(none): self.x = self.y = self.z = 0 end
def new(value: const ref T): self.x = self.y = self.z = value end
def new(x, y, z: const ref T):
self.x = x
self.y = y
self.z = z
end
def new(move: const mov vector3[T]):
self.x = move.x
self.y = move.y
self.z = move.z
end
def new(copy: const ref vector3[T]):
self.x = copy.x
self.y = copy.y
self.z = copy.z
end
/* methods */
def normalize(none):
value := cast[T](1.0 / self.length)
self.x *= value
self.y *= value
self.z *= value
end
def all(value: const ref T): self.x = self.y = self.z = value end
def one(none): self.x = self.y = self.z = cast[T](1) end
def zero(none): self.x = self.y = self.z = 0 end
/* properties */
x, y, z: T with
get: pass end
set: pass end
end
length_squared: const ref T with
get: (self.x * self.x) + (self.y * self.y) + (self.z * self.z) end
end
length: const ref T with
get: sqrt(self.length_squared) end
end
end /* namespace math */
[/code]
and turn it into whatever I want from there, though each backend will need a bit more semantic analysis, which might be tougher, but the YAML serves as nothing more than a specified syntax tree, and from it anything can be done. I like to think of it as my language's Object file :v:
of course, the actual generated YAML is going to have two options
1) Compact (JSON style)
2) Prettified (What you saw above)
So you won't have extremely huge amounts of text like the above. (for instance, once it's been "pythonified" the above text looks like this:
[code]
{'imports': ['math'], 'declarations': [{'type': 'namespace', 'name': 'math',
'members': [{'generic': True, 'type': 'class', 'name': 'vector3', 'members':
[{'args': None, 'type': 'constructor', 'contents': 'self.x = self.y = self.z
= 0'}, {'args': [{'modifiers': ['const', 'ref'], 'type': 'T', 'name':
'value'}], 'type': 'constructor', 'contents': 'self.x = self.y = self.z =
value'}, {'args': [{'modifiers': ['const', 'ref'], 'type': 'T', 'name':
'x'}, {'modifiers': ['const', 'ref'], 'type': 'T', 'name': 'y'},
{'modifiers': ['const', 'ref'], 'type': 'T', 'name': 'z'}], 'type':
'constructor', 'contents': 'self.x = x\nself.y = y\nself.z = z\n'}, {'args':
[{'modifiers': ['const', 'mov'], 'type': 'vector3[T]', 'name': 'move'}],
'type': 'constructor', 'contents': 'self.x = move.x\nself.y = move.y\nself.z
= move.z\n'}, {'args': [{'modifiers': ['const', 'ref'], 'type':
'vector3[T]', 'name': 'copy'}], 'type': 'constructor', 'contents': 'self.x =
copy.x\nself.y = copy.y\nself.z = copy.z\n'}, {'returns': 'none', 'args':
[{'modifiers': ['const', 'ref'], 'type': 'T', 'name': 'value'}], 'type':
'method', 'name': 'all', 'contents': 'self.x = self.y = self.z = value'},
{'returns': None, 'args': None, 'type': 'method', 'name': 'one', 'contents':
'self.x = self.y = self.z = cast[T](1)'}, {'returns': None, 'args': None,
'type': 'method', 'name': 'zero'}, {'contains': [{'get': [{'modifiers':
None, 'type': 'T', 'contents': None}]}, {'set': [{'modifiers': None, 'type':
'T', 'contents': None}]}], 'type': 'property', 'name': 'x'}, {'contains':
[{'get': [{'modifiers': None, 'type': 'T', 'contents': None}]}, {'set':
[{'modifiers': None, 'type': 'T', 'contents': None}]}], 'type': 'property',
'name': 'y'}, {'contains': [{'get': [{'modifiers': None, 'type': 'T',
'contents': None}]}, {'set': [{'modifiers': None, 'type': 'T', 'contents':
None}]}], 'type': 'property', 'name': 'z'}, {'contains': [{'get':
[{'modifiers': ['const', 'ref'], 'type': 'T', 'contents': 'sqrt
(self.length_squared)'}]}], 'type': 'property', 'name': 'length'},
{'contains': [{'get': [{'modifiers': ['const', 'ref'], 'type': 'T',
'contents': '(self.x * self.x) + (self.y * self.y) + (self.z * self.z)'}]}],
'type': 'property', 'name': 'length_squared'}], 'genericargs': ['T']}]}],
'name': 'vector3'}
[/code]
Terrifying
[QUOTE=stinkfire;25165515]Wow thats awesome. Thats the first time i have seen your work thing.
Can you add your own sounds or is it only piano? Also will you release this once you are finished?[/QUOTE]
You can add you own sounds.
I am going to be sampling all the instruments I have aswell as getting a friend to help out with his too.
And I will be releasing this, With source, Once I am comfortable that stuff can be made with it (The Adding and removing of the instruments is sketchy) :D
Yay, you can now mask which notes the random tiles can pick - So you can make sure it will actually sound musical hah
[code]
<ChangedTiles>
<Item>
<X>23</X>
<Y>14</Y>
<Note>11</Note>
<color>true</color>
<tiletype>OpenST.Tiles.RandomColorTile</tiletype>
<TileData>
<Item>
<Key>colors</Key>
<Value Type="Generic:List[int]">0 1</Value> <!-- Here -->
</Item>
</TileData>
</Item>
</ChangedTiles>
[/code]
[QUOTE=Tezzanator92;25171096]You can add you own sounds.
I am going to be sampling all the instruments I have aswell as getting a friend to help out with his too.
And I will be releasing this, With source, Once I am comfortable that stuff can be made with it (The Adding and removing of the instruments is sketchy) :D
Yay, you can now mask which notes the random tiles can pick - So you can make sure it will actually sound musical hah
[code]
<ChangedTiles>
<Item>
<X>23</X>
<Y>14</Y>
<Note>11</Note>
<color>true</color>
<tiletype>OpenST.Tiles.RandomColorTile</tiletype>
<TileData>
<Item>
<Key>colors</Key>
<Value Type="Generic:List[int]">0 1</Value> <!-- Here -->
</Item>
</TileData>
</Item>
</ChangedTiles>
[/code][/QUOTE]
:sax:
[img]http://dl.dropbox.com/u/286964/TuneTiles/Property.jpg[/img]
I was going to do this with my GUI system but it would have taken AGES to code all the reflection stuff to get the same end product. Maybe later when everything is working I will gradually move everything over to In-Game menus.
The only downside of using Forms objects is they don't work in full screen. I can live with that.
[QUOTE=Torrunt;25166674]I added a new combat system to my game where the more you hit stuff the higher your 'combo' bar goes up and the higher it is the more damage you do and the cooler you look (start glowing and stuff).
[IMG]http://localhostr.com/files/7a14b8/cloudcombo.jpg[/IMG]
(too freaking hard to get a screenshot just as he's attacking D:)
You can die now too.
[img_thumb]http://localhostr.com/files/fc9600/clouddead.jpg[/img_thumb]
Might release a short demo in a couple of weeks or so with a few maps and quests.[/QUOTE]
Those graphics. They are awesome.
[QUOTE=ZeekyHBomb;25157385]*words*[/QUOTE]
Thanks for the feedback! I appreciate all the tips, I'm only a few months into my course at the moment and had no C++ knowledge prior, only Lua. I'm not quite sure why I was rated dumb twice for the post though, I'm not an advanced or even intermediate C++ programmer, I've only really just begun.
As for returning a reference from the Instance function, I was taught to do it that way. I've also been taught to do my casting that way too, though I'll read up on C++ casting sytax. I think one of the reasons my code isn't to your liking is that I'm quite early in on my course, so we haven't been taught the more advanced ways of doing stuff yet.
[QUOTE=.kurozael;25172710]
As for returning a reference from the Instance function, I was taught to do it that way. I've also been taught to do my casting that way too, though I'll read up on C++ casting sytax. I think one of the reasons my code isn't to your liking is that I'm quite early in on my course, so we haven't been taught the more advanced ways of doing stuff yet.[/QUOTE]
It kind of sounds like your teacher simply isn't very up to date on modern C++. I see you use references in your event handling function though, not sure if that's due to copy-paste or not. You should really use references whenever feasible.
edit:
I bet the dumb ratings are due to the Games Programming course. Don't mind them though, your course seems pretty good (unless that code is a result of extensive research on your own).
Sorry, you need to Log In to post a reply to this thread.